path: root/builtin/checkout.c
diff options
authorThomas Rast <>2013-08-03 10:36:15 (GMT)
committerJunio C Hamano <>2013-08-05 15:27:00 (GMT)
commit838f9a15667cfefa9e645c26627ce81ce7599915 (patch)
tree77c06d6fb1c158f6d8f8b61920e65ab7b25579a2 /builtin/checkout.c
parent53d00b39ce00073ab6b450488acc3f532a223e8f (diff)
log: use true parents for diff when walking reflogs
The reflog walking logic (git log -g) replaces the true parent list with the preceding commit in the reflog. This results in bogus commit diffs when combined with options such as -p; the diff is against the reflog predecessor, not the parent of the commit. Save the true parents on the side, extending the functions from the previous commit. The diff logic picks them up and uses them to show the correct diffs. We do have to be somewhat careful about repeated calling of save_parents(), since the reflog may list a commit more than once. We now store (commit_list*)-1 to distinguish the "not saved yet" and "root commit" cases. This lets us preserve an empty parent list even if save_parents() is repeatedly called. Suggested-by: Jeff King <> Signed-off-by: Thomas Rast <> Signed-off-by: Junio C Hamano <>
Diffstat (limited to 'builtin/checkout.c')
0 files changed, 0 insertions, 0 deletions