protected function getCurrentUserInfo($git)
    {
        // Sadly no command in our git library for this.
        $arguments = [
            $git->getConfig()->getGitExecutablePath(),
            'config',
            '--get-regexp',
            'user.[name|email]'
        ];

        $process = new Process($this->prepareProcessArguments($arguments), $git->getRepositoryPath());

        $git->getConfig()->getLogger()->debug(
            \sprintf('[git-php] exec [%s] %s', $process->getWorkingDirectory(), $process->getCommandLine())
        );

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

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

        $config = array();
        foreach (\explode(PHP_EOL, $output) as $line) {
            list($name, $value)   = \explode(' ', $line, 2);
            $config[\trim($name)] = \trim($value);
        }

        if (isset($config['user.name']) && $config['user.email']) {
            return \sprintf('%s <%s>', $config['user.name'], $config['user.email']);
        }

        return '';
    }