X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=commit.c;h=e2bcbe814936989e7a86018e46ed6ca86f4c1f10;hb=cfe370c6476392095bc3f18013d195b1cccd6184;hp=a47fb4da271beaf5595b6bbbe41f94bad08f404d;hpb=73ccb916e4e733745e1361739b07f1ef3e97ae6b;p=git.git 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)