diff options
author | Junio C Hamano <gitster@pobox.com> | 2009-07-25 00:45:03 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-07-25 00:45:03 -0700 |
commit | 130b04ab37d74e574d525df7948b963b13c6bdbf (patch) | |
tree | a39a6d5e46d3ee24dcc1f2f141efe4f0a20a9581 /commit.c | |
parent | a7c1ef3e03985c70aeb0825634471bb6240f4fcb (diff) | |
parent | 7f3140cd23f126e578ccaaea8c2cebe36824a7ac (diff) | |
download | git-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.c | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -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) |