From: Shawn O. Pearce Date: Fri, 12 Jan 2007 02:25:01 +0000 (-0500) Subject: Fix repository corruption when using marks for modified blobs. X-Git-Tag: v1.5.0-rc4~14^2~47 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=cacbdd0afb481a6f3019e5e7db98f88e40941fd5;p=git.git Fix repository corruption when using marks for modified blobs. 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 --- diff --git a/fast-import.c b/fast-import.c index e35a89f6c..e9a46c6c3 100644 --- a/fast-import.c +++ b/fast-import.c @@ -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))