summaryrefslogtreecommitdiff
path: root/fast-import.c
diff options
context:
space:
mode:
authorShawn O. Pearce <spearce@spearce.org>2007-01-12 02:25:01 (GMT)
committerShawn O. Pearce <spearce@spearce.org>2007-01-14 07:15:11 (GMT)
commitcacbdd0afb481a6f3019e5e7db98f88e40941fd5 (patch)
tree5920db2442543c86e76671e358f0e51620f23101 /fast-import.c
parent8a8c55ea709d26ca397d6588e85579339885f507 (diff)
downloadgit-cacbdd0afb481a6f3019e5e7db98f88e40941fd5.zip
git-cacbdd0afb481a6f3019e5e7db98f88e40941fd5.tar.gz
git-cacbdd0afb481a6f3019e5e7db98f88e40941fd5.tar.bz2
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 <spearce@spearce.org>
Diffstat (limited to 'fast-import.c')
-rw-r--r--fast-import.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/fast-import.c b/fast-import.c
index e35a89f..e9a46c6 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))