diff --git a/lib/scm/gitrepo.class.php b/lib/scm/gitrepo.class.php index ad805caf62..1fd46f4fbe 100644 --- a/lib/scm/gitrepo.class.php +++ b/lib/scm/gitrepo.class.php @@ -310,7 +310,9 @@ class GitRepo if(strpos($fromRevision, '^') !== false) { $list = execCmd(escapeCmd("$this->client log -2 $toRevision --pretty=format:%H -- $path"), 'array'); - if(isset($list[1])) $fromRevision = $list[1]; + if(!isset($list[1])) return execCmd(escapeCmd("$this->client show HEAD"), 'array'); + + $fromRevision = $list[1]; } $lines = execCmd(escapeCmd("$this->client diff $fromRevision $toRevision -- $path"), 'array'); return $lines;