From 24b71fa7ec6b6c67024a17f7b58490e4a2be53b1 Mon Sep 17 00:00:00 2001 From: Tobias Schlitt Date: Wed, 25 Sep 2013 19:45:26 +0200 Subject: [PATCH 1/3] Fixed: Allow Git special versions to be used for diff. While this is not strictly in the sense of an abstraction layer, this patch allows to use Git special revision keywords (e.g. HEAD or $version^) for diffing, which is useful for some cases. --- src/main/php/Arbit/VCSWrapper/GitCli/Resource.php | 4 ---- 1 file changed, 4 deletions(-) diff --git a/src/main/php/Arbit/VCSWrapper/GitCli/Resource.php b/src/main/php/Arbit/VCSWrapper/GitCli/Resource.php index 79241ae..fd2f784 100644 --- a/src/main/php/Arbit/VCSWrapper/GitCli/Resource.php +++ b/src/main/php/Arbit/VCSWrapper/GitCli/Resource.php @@ -267,10 +267,6 @@ public function getLogEntry($version) */ public function getDiff($version, $current = null) { - if (!in_array($version, $this->getVersions(), true)) { - throw new \UnexpectedValueException("Invalid log entry $version for {$this->path}."); - } - $current = ($current === null) ? $this->getVersionString() : $current; if (($diff = \Arbit\VCSWrapper\Cache\Manager::get($this->path, $version, 'diff')) === false) { From 89f24e2988c58146698ba08d48da7156931c5be1 Mon Sep 17 00:00:00 2001 From: Tobias Schlitt Date: Thu, 26 Sep 2013 22:57:33 +0200 Subject: [PATCH 2/3] Fixed: Ambiguous revision arguments. --- src/main/php/Arbit/VCSWrapper/GitCli/Resource.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/php/Arbit/VCSWrapper/GitCli/Resource.php b/src/main/php/Arbit/VCSWrapper/GitCli/Resource.php index fd2f784..fd53333 100644 --- a/src/main/php/Arbit/VCSWrapper/GitCli/Resource.php +++ b/src/main/php/Arbit/VCSWrapper/GitCli/Resource.php @@ -273,7 +273,7 @@ public function getDiff($version, $current = null) // Refetch the basic content information, and cache it. $process = new \Arbit\VCSWrapper\GitCli\Process(); $process->workingDirectory($this->root); - $process->argument('diff')->argument('--no-ext-diff'); + $process->argument('diff')->argument('--no-ext-diff')->argument('--'); $process->argument($version . '..' . $current)->argument(new \SystemProcess\Argument\PathArgument('.' . $this->path))->execute(); // Parse resulting unified diff From 4d1b5ee9b662b6ad02b3447f11a87df026835d90 Mon Sep 17 00:00:00 2001 From: Tobias Schlitt Date: Fri, 27 Sep 2013 06:16:28 +0200 Subject: [PATCH 3/3] Revert "Fixed: Ambiguous revision arguments." This reverts commit 89f24e2988c58146698ba08d48da7156931c5be1. It actually broke diffing completely. Sorry. --- src/main/php/Arbit/VCSWrapper/GitCli/Resource.php | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/php/Arbit/VCSWrapper/GitCli/Resource.php b/src/main/php/Arbit/VCSWrapper/GitCli/Resource.php index fd53333..fd2f784 100644 --- a/src/main/php/Arbit/VCSWrapper/GitCli/Resource.php +++ b/src/main/php/Arbit/VCSWrapper/GitCli/Resource.php @@ -273,7 +273,7 @@ public function getDiff($version, $current = null) // Refetch the basic content information, and cache it. $process = new \Arbit\VCSWrapper\GitCli\Process(); $process->workingDirectory($this->root); - $process->argument('diff')->argument('--no-ext-diff')->argument('--'); + $process->argument('diff')->argument('--no-ext-diff'); $process->argument($version . '..' . $current)->argument(new \SystemProcess\Argument\PathArgument('.' . $this->path))->execute(); // Parse resulting unified diff