protected function preInitBranchPackage(VcsDriverInterface $driver, array $data, $branch, $identifier)
    {
        $packageName = $this->createPackageName();
        $data = array_merge($this->createMockOfPackageConfig($packageName, $branch), $data);
        $data = $this->preProcessAsset($data);
        $data['version'] = $branch;
        $data = $this->configureBranchPackage($branch, $data);

        if (!isset($data['dist'])) {
            $data['dist'] = $driver->getDist($identifier);
        }
        if (!isset($data['source'])) {
            $data['source'] = $driver->getSource($identifier);
        }

        $loader = new ArrayLoader();
        $package = $loader->load($data);
        $package = $this->includeBranchAlias($driver, $package, $branch);
        $this->addPackage($package);
    }