]> git.ipfire.org Git - thirdparty/git.git/commit - git-merge-one-file.sh
merge: detect delete/modechange conflict
authorJeff King <peff@peff.net>
Mon, 26 Oct 2015 21:39:39 +0000 (17:39 -0400)
committerJunio C Hamano <gitster@pobox.com>
Mon, 26 Oct 2015 21:49:31 +0000 (14:49 -0700)
commit72fac66bca302dbecbe42dfa0ddc7e42db2fe567
tree97e26848665103abaa696be186d549e747e7a8ea
parentf78d1fe208d3db36afecbd8b8a84d6c35391bd0b
merge: detect delete/modechange conflict

If one side deletes a file and the other changes its
content, we notice and report a conflict. However, if
instead of changing the content, we change only the mode,
the merge does not notice (and the mode change is silently
dropped).

The trivial index merge notices the problem and correctly
leaves the conflict in the index, but both merge-recursive
and merge-one-file will silently resolve this in favor of
the deletion.  In many cases that is a sane resolution, but
we should be punting to the user whenever there is any
question. So let's detect and treat this as a conflict (in
both strategies).

Signed-off-by: Jeff King <peff@peff.net>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
git-merge-one-file.sh
merge-recursive.c
t/t6031-merge-filemode.sh