summaryrefslogtreecommitdiff
path: root/t/t6031-merge-filemode.sh
AgeCommit message (Collapse)Author
2015-10-26merge: detect delete/modechange conflictJeff King
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>
2015-10-26t6031: generalize for recursive and resolve strategiesJeff King
This script tests the filemode handling of merge-recursive, but we do not test the same thing for merge-resolve. Let's generalize the script a little: 1. Break out the setup steps for each test into a separate snippet. 2. For each test, run it twice; once with "-s recursive" and once with "-s resolve". We can avoid repeating ourselves by adding a function. 3. Since we have a nice abstracted function, we can make our tests more thorough by testing both directions (change on "ours" versus "theirs"). This improves our test coverage, and will make this the place to add more tests related to merging mode changes. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>