git-svn: extract base blob in generate_diff
authorFlorian Weimer <fw@deneb.enyo.de>
Sun, 31 Aug 2008 15:05:09 +0000 (17:05 +0200)
committerEric Wong <normalperson@yhbt.net>
Fri, 5 Sep 2008 23:58:38 +0000 (16:58 -0700)
We need the base blob to compute a delta to be sent to the server.

Signed-off-by: Florian Weimer <fw@deneb.enyo.de>
Acked-by: Eric Wong <normalperson@yhbt.net>
git-svn.perl

index 7a1d26db8bcc451545fad2f8d55d43a5079d2302..0479f41b50646b64e0f8a8c7358201e17e1bed49 100755 (executable)
@@ -3380,11 +3380,12 @@ sub generate_diff {
        while (<$diff_fh>) {
                chomp $_; # this gets rid of the trailing "\0"
                if ($state eq 'meta' && /^:(\d{6})\s(\d{6})\s
-                                       $::sha1\s($::sha1)\s
+                                       ($::sha1)\s($::sha1)\s
                                        ([MTCRAD])\d*$/xo) {
                        push @mods, {   mode_a => $1, mode_b => $2,
-                                       sha1_b => $3, chg => $4 };
-                       if ($4 =~ /^(?:C|R)$/) {
+                                       sha1_a => $3, sha1_b => $4,
+                                       chg => $5 };
+                       if ($5 =~ /^(?:C|R)$/) {
                                $state = 'file_a';
                        } else {
                                $state = 'file_b';