summaryrefslogtreecommitdiff
path: root/t/t6036-recursive-corner-cases.sh
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2018-07-01 04:11:22 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-07-11 15:40:29 (GMT)
commit5d1daf30cce5744b219002e0a6da015a13216cd1 (patch)
tree941fd62b23af3f02871c20b38b276b60b223a2e3 /t/t6036-recursive-corner-cases.sh
parent451a3abc262575e5ed325b71547d345c55cc7d1d (diff)
downloadgit-5d1daf30cce5744b219002e0a6da015a13216cd1.zip
git-5d1daf30cce5744b219002e0a6da015a13216cd1.tar.gz
git-5d1daf30cce5744b219002e0a6da015a13216cd1.tar.bz2
t6036: add a failed conflict detection case: regular files, different modes
Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t6036-recursive-corner-cases.sh')
-rwxr-xr-xt/t6036-recursive-corner-cases.sh67
1 files changed, 67 insertions, 0 deletions
diff --git a/t/t6036-recursive-corner-cases.sh b/t/t6036-recursive-corner-cases.sh
index 8b997d7..5a8fe06 100755
--- a/t/t6036-recursive-corner-cases.sh
+++ b/t/t6036-recursive-corner-cases.sh
@@ -1189,4 +1189,71 @@ test_expect_failure 'check conflicting entry types (submodule vs symlink)' '
)
'
+#
+# criss-cross with regular files that have conflicting modes:
+#
+# B D
+# o---o
+# / \ / \
+# A o X ? F
+# \ / \ /
+# o---o
+# C E
+#
+# Commit A: nothing of note
+# Commit B: introduce file source_me.bash, not executable
+# Commit C: introduce file source_me.bash, executable
+# Commit D: merge B&C, resolving in favor of B
+# Commit E: merge B&C, resolving in favor of C
+#
+# This is an obvious add/add mode conflict. Can git detect it?
+
+test_expect_success 'setup conflicting modes for regular file' '
+ test_create_repo regular-file-mode-conflict &&
+ (
+ cd regular-file-mode-conflict &&
+
+ touch irrelevant-file &&
+ git add irrelevant-file &&
+ git commit -m A &&
+ git tag A &&
+
+ git checkout -b B A &&
+ echo "command_to_run" >source_me.bash &&
+ git add source_me.bash &&
+ git commit -m B &&
+
+ git checkout -b C A &&
+ echo "command_to_run" >source_me.bash &&
+ git add source_me.bash &&
+ test_chmod +x source_me.bash &&
+ git commit -m C &&
+
+ git checkout -q B^0 &&
+ git merge -s ours -m D C^0 &&
+ git tag D &&
+
+ git checkout -q C^0 &&
+ git merge -s ours -m E B^0 &&
+ git tag E
+ )
+'
+
+test_expect_failure 'check conflicting modes for regular file' '
+ (
+ cd regular-file-mode-conflict &&
+
+ git checkout D^0 &&
+
+ test_must_fail git merge -s recursive E^0 &&
+
+ git ls-files -s >out &&
+ test_line_count = 3 out &&
+ git ls-files -u >out &&
+ test_line_count = 2 out &&
+ git ls-files -o >out &&
+ test_line_count = 1 out
+ )
+'
+
test_done