From: Michael M Slusarz Date: Wed, 7 Jan 2009 06:19:03 +0000 (-0700) Subject: Vcs updates from CVS HEAD. X-Git-Url: https://git.internetallee.de/?a=commitdiff_plain;h=11b7d5909e991d88695bd2ecd050d01c29f5cc66;p=horde.git Vcs updates from CVS HEAD. --- diff --git a/framework/Vcs/lib/Horde/Vcs/Git.php b/framework/Vcs/lib/Horde/Vcs/Git.php index 1d787b8a9..9983146cc 100644 --- a/framework/Vcs/lib/Horde/Vcs/Git.php +++ b/framework/Vcs/lib/Horde/Vcs/Git.php @@ -230,7 +230,16 @@ class Horde_Vcs_Diff_git extends Horde_Vcs_Diff */ public function getRevisionRange($rep, $file, $r1, $r2) { - $cmd = $rep->getCommand() . ' rev-list ' . $r1 . '..' . $r2 . ' -- "' . $file->queryModulePath() . '"'; + $revs = $this->_getRevisionRange($rep, $file, $r1, $r2); + if (empty($revs)) { + $revs = array_reverse($this->_getRevisionRange($rep, $file, $r2, $r1)); + } + return $revs; + } + + private function _getRevisionRange($rep, $file, $r1, $r2) + { + $cmd = $rep->getCommand() . ' rev-list ' . $r1 . '..' . $r2 . ' -- "' . $file->queryModulePath() . '"'e $pipe = popen($cmd, 'r'); if (!is_resource($pipe)) { throw new Horde_Vcs_Exception('Unable to run ' . $cmd . ': ' . error_get_last());