致命:参数'%cI'模棱两可:未知修订或路径不在工作树中

时间:2018-07-10 03:49:04

标签: php git

我正在尝试从php脚本级别执行这样的命令:

git log --pretty='format:%H %cI %s' v1.13.3..v1.13.3

但我收到一条消息

fatal: ambiguous argument '%cI': unknown revision or path not in the working tree.

执行代码如下:

protected static function run(string $command)
    {
        $process = proc_open($command, [
            1 => ['pipe', 'w'],
            2 => ['pipe', 'w']
        ], $pipes);

        if (false !== $process) {
            list(, $stdout, $stderr) = array_map(function ($resource) {
                $content = explode("\n", stream_get_contents($resource));
                fclose($resource);

                return $content;
            }, $pipes);

            $status = proc_close($process);

            if ($status !== 0) {
                $error = count($stderr) ? ': ' . implode("\n", $stderr) : '';
                throw new ExecutionException(sprintf("Executing process '%s' failed" . $error, $command));
            }

            return $stdout;
        }

        throw new ExecutionException(sprintf("Failed opening process '%s'", $command));
    }

我不做什么,为什么脚本不想执行该命令?

0 个答案:

没有答案