summaryrefslogtreecommitdiff
path: root/builtin/interpret-trailers.c
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2019-08-15 14:40:31 -0700
committerJunio C Hamano <gitster@pobox.com>2019-08-16 12:47:20 -0700
commit65c01c644250fb0a92f929c2fc61f33771bf480f (patch)
treef0cd0dbe3cf0b39f52a836390a36f1d8aff294c6 /builtin/interpret-trailers.c
parentd8523ca1b90641be4bddcdfc50fbf3a1be34adae (diff)
downloadgit-65c01c644250fb0a92f929c2fc61f33771bf480f.tar.gz
checkout: provide better conflict hunk description with detached HEAD
When running 'git checkout -m' and using diff3 style conflict markers, we want all the conflict hunks (left-side, "common" or "merge base", and right-side) to have label markers letting the user know where each came from. The "common" hunk label (o.ancestor) came from old_branch_info->name, but that is NULL when HEAD is detached, which resulted in a blank label. Check for that case and provide an abbreviated commit hash instead. (Incidentally, this was the only case in the git codebase where merge_trees() was called with opt->ancestor being NULL. A subsequent commit will prevent similar problems by enforcing that merge_trees() always be called with opt->ancestor != NULL.) Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin/interpret-trailers.c')
0 files changed, 0 insertions, 0 deletions