File tree Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Expand file tree Collapse file tree 2 files changed +11
-7
lines changed Original file line number Diff line number Diff line change @@ -2472,12 +2472,16 @@ sub close_file {
2472
2472
my $hash ;
2473
2473
my $path = $self -> git_path($fb -> {path });
2474
2474
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
+ }
2481
2485
sysseek($fh , 0, 0) or croak $! ;
2482
2486
if ($fb -> {mode_b } == 120000) {
2483
2487
sysread ($fh , my $buf , 5) == 5 or croak $! ;
Original file line number Diff line number Diff line change @@ -26,7 +26,7 @@ struct tag *lookup_tag(const unsigned char *sha1)
26
26
if (!obj -> type )
27
27
obj -> type = OBJ_TAG ;
28
28
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 " ,
30
30
sha1_to_hex (sha1 ), typename (obj -> type ));
31
31
return NULL ;
32
32
}
You can’t perform that action at this time.
0 commit comments