@matheusbsbs / matheus-bagliano / commits / 2d0c8accc3
Fork 0

git-svn: extract base blob in generate_diff

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>

Florian Weimer committed Aug 31, 2008 at 17:05 UTC 2d0c8accc3fa7de75d7cbe732873ce5a57379020
1 file changed +4 -3
git-svn.perl
+4 -3
@@ -3380,11 +3380,12 @@ sub generate_diff {
3380 while (<$diff_fh>) {
3381 chomp $_; # this gets rid of the trailing "\0"
3382 if ($state eq 'meta' && /^:(\d{6})\s(\d{6})\s
3383 - $::sha1\s($::sha1)\s
3383 + ($::sha1)\s($::sha1)\s
3384 ([MTCRAD])\d*$/xo) {
3385 push @mods, { mode_a => $1, mode_b => $2,
3386 - sha1_b => $3, chg => $4 };
3387 - if ($4 =~ /^(?:C|R)$/) {
3386 + sha1_a => $3, sha1_b => $4,
3387 + chg => $5 };
3388 + if ($5 =~ /^(?:C|R)$/) {
3389 $state = 'file_a';
3390 } else {
3391 $state = 'file_b';