Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2008-05-28 10:33:22 +0400
committerJunio C Hamano <gitster@pobox.com>2008-05-28 10:35:55 +0400
commitd683a0e00cd4734b4fab704baef1ee76205722be (patch)
tree5bd68609cb1d489f83455bda25200d4050415fd7 /git-svn.perl
parentb2a42f55bc419352b848751b0763b0a2d1198479 (diff)
Git::cat_blob: allow using an empty blob to fix git-svn breakage
Recent "git-svn optimization" series introduced Git::cat_blob() subroutine whose interface was broken in that it returned the size of the blob but signalled an error by returning 0. You can never use an empty blob with such an interface. This fixes the interface to return a negative value to signal an error. Reported by Björn Steinbrink. Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'git-svn.perl')
-rwxr-xr-xgit-svn.perl4
1 files changed, 2 insertions, 2 deletions
diff --git a/git-svn.perl b/git-svn.perl
index 37976f2505..3a6eb1cb9d 100755
--- a/git-svn.perl
+++ b/git-svn.perl
@@ -3191,7 +3191,7 @@ sub apply_textdelta {
if ($fb->{blob}) {
print $base 'link ' if ($fb->{mode_a} == 120000);
my $size = $::_repository->cat_blob($fb->{blob}, $base);
- die "Failed to read object $fb->{blob}" unless $size;
+ die "Failed to read object $fb->{blob}" if ($size < 0);
if (defined $exp) {
seek $base, 0, 0 or croak $!;
@@ -3570,7 +3570,7 @@ sub chg_file {
$self->change_file_prop($fbat,'svn:special',undef);
}
my $size = $::_repository->cat_blob($m->{sha1_b}, $fh);
- croak "Failed to read object $m->{sha1_b}" unless $size;
+ croak "Failed to read object $m->{sha1_b}" if ($size < 0);
$fh->flush == 0 or croak $!;
seek $fh, 0, 0 or croak $!;