1
0
Fork 0
mirror of https://github.com/git/git.git synced 2024-06-09 19:56:17 +02:00

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>
This commit is contained in:
Florian Weimer 2008-08-31 17:05:09 +02:00 committed by Eric Wong
parent 80d12c23de
commit 2d0c8accc3

View File

@ -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';