On 9/1/2022 5:41 AM, ZheNing Hu via GitGitGadget wrote: > From: ZheNing Hu <adlternative@xxxxxxxxx> > > In repo_parse_commit_internal(), if we want to use > commit graph, it will call parse_commit_in_graph() to > parse commit's content from commit graph, otherwise > call repo_read_object_file() to parse commit's content > from commit object. > > repo_read_object_file() will respect commit graft, > which can correctly amend commit's parents. But > parse_commit_in_graph() not. Inconsistencies here may > result in incorrect processing of shallow clone. > > So let parse_commit_in_graph() respect commit graft as > repo_read_object_file() does, which can solve this problem. If grafts or replace-objects exist, then the commit-graph is disabled and this code will never be called. I would expect a test case demonstrating the change in behavior here, but that is impossible. The commit-graph parsing should not be bogged down with this logic. Thanks, -Stolee