* Fix diff page empty when revision is first commit.
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user