aboutsummaryrefslogtreecommitdiff
path: root/commit.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-07-25 00:45:03 -0700
committerJunio C Hamano <gitster@pobox.com>2009-07-25 00:45:03 -0700
commit130b04ab37d74e574d525df7948b963b13c6bdbf (patch)
treea39a6d5e46d3ee24dcc1f2f141efe4f0a20a9581 /commit.c
parenta7c1ef3e03985c70aeb0825634471bb6240f4fcb (diff)
parent7f3140cd23f126e578ccaaea8c2cebe36824a7ac (diff)
downloadgit-130b04ab37d74e574d525df7948b963b13c6bdbf.tar.gz
git-130b04ab37d74e574d525df7948b963b13c6bdbf.tar.xz
Merge branch 'js/maint-graft-unhide-true-parents'
* js/maint-graft-unhide-true-parents: git repack: keep commits hidden by a graft Add a test showing that 'git repack' throws away grafted-away parents Conflicts: git-repack.sh
Diffstat (limited to 'commit.c')
-rw-r--r--commit.c6
1 files changed, 5 insertions, 1 deletions
diff --git a/commit.c b/commit.c
index a47fb4da2..e2bcbe814 100644
--- a/commit.c
+++ b/commit.c
@@ -262,7 +262,11 @@ int parse_commit_buffer(struct commit *item, void *buffer, unsigned long size)
bufptr[47] != '\n')
return error("bad parents in commit %s", sha1_to_hex(item->object.sha1));
bufptr += 48;
- if (graft)
+ /*
+ * The clone is shallow if nr_parent < 0, and we must
+ * not traverse its real parents even when we unhide them.
+ */
+ if (graft && (graft->nr_parent < 0 || grafts_replace_parents))
continue;
new_parent = lookup_commit(parent);
if (new_parent)