From: Junio C Hamano Date: Sat, 17 Jan 2026 18:37:38 +0000 (-0800) Subject: Merge branch 'sp/shallow-time-boundary' into seen X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=faf62bcf7f28ef38b54507abc55e9191f9a310a9;p=thirdparty%2Fgit.git Merge branch 'sp/shallow-time-boundary' into seen The set of shallow boundary "git clone --shallow-since" leaves contained commits that are not on the boundary, which has been corrected. * sp/shallow-time-boundary: shallow: set borders which are all reachable after clone shallow since --- faf62bcf7f28ef38b54507abc55e9191f9a310a9 diff --cc shallow.c index 7c237bd48b,a12c031ce8..471fc52337 --- a/shallow.c +++ b/shallow.c @@@ -278,13 -284,26 +301,26 @@@ struct commit_list *get_shallow_commits oid_to_hex(&c->object.oid)); for (parent = c->parents; parent; parent = parent->next) - if (!(parent->item->object.flags & not_shallow_flag)) { + if (parent->item->object.flags & not_shallow_flag) { + must_not_be_shallow = 1; + } else { c->object.flags |= shallow_flag; - commit_list_insert(c, &result); - break; + parent->item->object.flags |= shallow_flag; } + if (must_not_be_shallow) { + c->object.flags &= ~shallow_flag; + for (parent = c->parents; parent; parent = parent->next) + if (parent->item->object.flags & shallow_flag) { + parent->item->object.flags |= not_shallow_flag; + commit_list_insert(parent->item, &result); + } + } else { + for (parent = c->parents; parent; parent = parent->next) + parent->item->object.flags &= ~shallow_flag; + commit_list_insert(c, &result); + } } - free_commit_list(not_shallow_list); + commit_list_free(not_shallow_list); /* * Now we can clean up NOT_SHALLOW on border commits. Having