Skip to content

Commit cdd5b82

Browse files
author
Junio C Hamano
committed
Merge branch 'maint-1.5.1' into maint
* maint-1.5.1: git-svn: avoid md5 calculation entirely if SVN doesn't provide one Fix stupid typo in lookup_tag()
2 parents c63a3ad + 7faf068 commit cdd5b82

File tree

2 files changed

+11
-7
lines changed

2 files changed

+11
-7
lines changed

git-svn.perl

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -2472,12 +2472,16 @@ sub close_file {
24722472
my $hash;
24732473
my $path = $self->git_path($fb->{path});
24742474
if (my $fh = $fb->{fh}) {
2475-
seek($fh, 0, 0) or croak $!;
2476-
my $md5 = Digest::MD5->new;
2477-
$md5->addfile($fh);
2478-
my $got = $md5->hexdigest;
2479-
die "Checksum mismatch: $path\n",
2480-
"expected: $exp\n got: $got\n" if (defined $exp && $got ne $exp);
2475+
if (defined $exp) {
2476+
seek($fh, 0, 0) or croak $!;
2477+
my $md5 = Digest::MD5->new;
2478+
$md5->addfile($fh);
2479+
my $got = $md5->hexdigest;
2480+
if ($got ne $exp) {
2481+
die "Checksum mismatch: $path\n",
2482+
"expected: $exp\n got: $got\n";
2483+
}
2484+
}
24812485
sysseek($fh, 0, 0) or croak $!;
24822486
if ($fb->{mode_b} == 120000) {
24832487
sysread($fh, my $buf, 5) == 5 or croak $!;

tag.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ struct tag *lookup_tag(const unsigned char *sha1)
2626
if (!obj->type)
2727
obj->type = OBJ_TAG;
2828
if (obj->type != OBJ_TAG) {
29-
error("Object %s is a %s, not a tree",
29+
error("Object %s is a %s, not a tag",
3030
sha1_to_hex(sha1), typename(obj->type));
3131
return NULL;
3232
}

0 commit comments

Comments
 (0)