From 11b7d5909e991d88695bd2ecd050d01c29f5cc66 Mon Sep 17 00:00:00 2001 From: Michael M Slusarz Date: Tue, 6 Jan 2009 23:19:03 -0700 Subject: [PATCH] Vcs updates from CVS HEAD. --- framework/Vcs/lib/Horde/Vcs/Git.php | 11 ++++++++++- 1 file changed, 10 insertions(+), 1 deletion(-) 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()); -- 2.11.0