Code

gitview: Fix the blame interface.
[git.git] / fast-import.c
index f5107df74d248afc7e2e2d45f7128fb7779fdfdc..f9bfcc72c87bf79fcb7a5faef01bc0d12aa15420 100644 (file)
@@ -1272,7 +1272,7 @@ static int update_branch(struct branch *b)
 
        if (read_ref(b->name, old_sha1))
                hashclr(old_sha1);
-       lock = lock_any_ref_for_update(b->name, old_sha1);
+       lock = lock_any_ref_for_update(b->name, old_sha1, 0);
        if (!lock)
                return error("Unable to lock %s", b->name);
        if (!force_update && !is_null_sha1(old_sha1)) {
@@ -1709,14 +1709,16 @@ static void cmd_from(struct branch *b)
        } else if (*from == ':') {
                uintmax_t idnum = strtoumax(from + 1, NULL, 10);
                struct object_entry *oe = find_mark(idnum);
-               unsigned long size;
-               char *buf;
                if (oe->type != OBJ_COMMIT)
                        die("Mark :%" PRIuMAX " not a commit", idnum);
                hashcpy(b->sha1, oe->sha1);
-               buf = gfi_unpack_entry(oe, &size);
-               cmd_from_commit(b, buf, size);
-               free(buf);
+               if (oe->pack_id != MAX_PACK_ID) {
+                       unsigned long size;
+                       char *buf = gfi_unpack_entry(oe, &size);
+                       cmd_from_commit(b, buf, size);
+                       free(buf);
+               } else
+                       cmd_from_existing(b);
        } else if (!get_sha1(from, b->sha1))
                cmd_from_existing(b);
        else