sebastianbergmann/diff

Diff with multiple chunks not working correctly

mazen opened this issue · 1 comments

The Parser fails on diffs with multiple chunks. Reason seems to be that after matching the first chunk in a file more chunks are not processed any further and are just considered as normal lines.

Example diff to reproduce:

diff --git a/test.php b/test.php
index c35bc79..eb1d4c5 100644
--- a/test.php
+++ b/test.php
@@ -9,7 +9,7 @@ use Foo as Bar;
  */
 class Baz {

-       private $args;
+       private $argsWhichHasBeenEdited;

        public function __construct($args, Bar $bar = null) {
                $this->args = $args;
@@ -18,6 +18,10 @@ class Baz {
        public function getArgs() {
                return $this->args;
        }
+
+       public function aNewFunction() {
+               return $this->args;
+       }
 }

only the chunk @-9,7 +9,7 is available as its own object

Ignore me, this is already fixed in master