]> git.ipfire.org Git - thirdparty/git.git/commit - merge-recursive.c
merge-recursive: combine error handling
authorDerrick Stolee <stolee@gmail.com>
Thu, 8 Nov 2018 04:40:31 +0000 (20:40 -0800)
committerJunio C Hamano <gitster@pobox.com>
Thu, 8 Nov 2018 05:23:54 +0000 (14:23 +0900)
commit80cee6e3210120a8a45fc4818e0049f482247b0f
tree4ee78d79433a13358a90704610eaf740f11c64f6
parentb8cd1bb71306e489d73e5cf4ef75a6cdb4c223b7
merge-recursive: combine error handling

In handle_rename_rename_1to2(), we have duplicated error handling
around colliding paths. Specifically, when we want to write out
the file and there is a directory or untracked file in the way,
we need to create a temporary file to hold the contents. This has
some special output to alert the user, and this output is
duplicated for each side of the conflict.

Simplify the call by generating this new path in a helper
function.

Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
Signed-off-by: Elijah Newren <newren@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
merge-recursive.c