]> asedeno.scripts.mit.edu Git - git.git/commitdiff
Fix repository corruption when using marks for modified blobs.
authorShawn O. Pearce <spearce@spearce.org>
Fri, 12 Jan 2007 02:25:01 +0000 (21:25 -0500)
committerShawn O. Pearce <spearce@spearce.org>
Sun, 14 Jan 2007 07:15:11 +0000 (02:15 -0500)
Apparently we did not copy the blob SHA1 into the stack variable
'sha1' when a mark is used to refer to a prior blob.  This code
was not previously tested as the Mozilla CVS -> git-fast-import
program always fed us full SHA1s for modified blobs and did not
use the mark feature there.

Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
fast-import.c

index e35a89f6cd8388d70ee7a388c284c46816ba97bb..e9a46c6c3ace0a8c7646eaf4e8ae29ba4d5fc65f 100644 (file)
@@ -1378,6 +1378,7 @@ static void file_change_m(struct branch *b)
        if (*p == ':') {
                char *x;
                oe = find_mark(strtoul(p + 1, &x, 10));
+               hashcpy(sha1, oe->sha1);
                p = x;
        } else {
                if (get_sha1_hex(p, sha1))