Merge branch 'maint-1.5.1' into maint
authorJunio C Hamano <junkio@cox.net>
Tue, 29 May 2007 06:54:26 +0000 (23:54 -0700)
committerJunio C Hamano <junkio@cox.net>
Tue, 29 May 2007 06:54:26 +0000 (23:54 -0700)
* maint-1.5.1:
git-svn: avoid md5 calculation entirely if SVN doesn't provide one
Fix stupid typo in lookup_tag()

git-svn.perl
tag.c
index fa46236ae854e4f1e2bebcf9cb3ec5ab57ec978c..e35006142af766080b3bafe0cdcd39bf2ccf3f04 100755 (executable)
@@ -2472,12 +2472,16 @@ sub close_file {
        my $hash;
        my $path = $self->git_path($fb->{path});
        if (my $fh = $fb->{fh}) {
-               seek($fh, 0, 0) or croak $!;
-               my $md5 = Digest::MD5->new;
-               $md5->addfile($fh);
-               my $got = $md5->hexdigest;
-               die "Checksum mismatch: $path\n",
-                   "expected: $exp\n    got: $got\n" if (defined $exp && $got ne $exp);
+               if (defined $exp) {
+                       seek($fh, 0, 0) or croak $!;
+                       my $md5 = Digest::MD5->new;
+                       $md5->addfile($fh);
+                       my $got = $md5->hexdigest;
+                       if ($got ne $exp) {
+                               die "Checksum mismatch: $path\n",
+                                   "expected: $exp\n    got: $got\n";
+                       }
+               }
                sysseek($fh, 0, 0) or croak $!;
                if ($fb->{mode_b} == 120000) {
                        sysread($fh, my $buf, 5) == 5 or croak $!;
diff --git a/tag.c b/tag.c
index 330d287924765c95dac428f040b104930c316b81..bbacd59a23f7994980f4bf017324833ca3d4adb3 100644 (file)
--- a/tag.c
+++ b/tag.c
@@ -26,7 +26,7 @@ struct tag *lookup_tag(const unsigned char *sha1)
        if (!obj->type)
                obj->type = OBJ_TAG;
         if (obj->type != OBJ_TAG) {
-                error("Object %s is a %s, not a tree",
+                error("Object %s is a %s, not a tag",
                       sha1_to_hex(sha1), typename(obj->type));
                 return NULL;
         }