private function runCustomGit(array $arguments, GitRepository $git)
    {
        $process = new Process($this->prepareProcessArguments($arguments), $git->getRepositoryPath());
        $git->getConfig()->getLogger()->debug(
            \sprintf('[git-php] exec [%s] %s', $process->getWorkingDirectory(), $process->getCommandLine())
        );

        $process->run();
        $result = rtrim($process->getOutput(), "\r\n");

        if (!$process->isSuccessful()) {
            throw GitException::createFromProcess('Could not execute git command', $process);
        }

        return $result;
    }