summaryrefslogtreecommitdiff
path: root/t/t6436-merge-overwrite.sh
diff options
context:
space:
mode:
Diffstat (limited to 't/t6436-merge-overwrite.sh')
-rwxr-xr-xt/t6436-merge-overwrite.sh18
1 files changed, 13 insertions, 5 deletions
diff --git a/t/t6436-merge-overwrite.sh b/t/t6436-merge-overwrite.sh
index dd8ab7ede1..dd9376842f 100755
--- a/t/t6436-merge-overwrite.sh
+++ b/t/t6436-merge-overwrite.sh
@@ -97,11 +97,19 @@ test_expect_success 'will not overwrite unstaged changes in renamed file' '
git mv c1.c other.c &&
git commit -m rename &&
cp important other.c &&
- test_must_fail git merge c1a >out &&
- test_i18ngrep "Refusing to lose dirty file at other.c" out &&
- test_path_is_file other.c~HEAD &&
- test $(git hash-object other.c~HEAD) = $(git rev-parse c1a:c1.c) &&
- test_cmp important other.c
+ if test "$GIT_TEST_MERGE_ALGORITHM" = ort
+ then
+ test_must_fail git merge c1a >out 2>err &&
+ test_i18ngrep "would be overwritten by merge" err &&
+ test_cmp important other.c &&
+ test_path_is_missing .git/MERGE_HEAD
+ else
+ test_must_fail git merge c1a >out &&
+ test_i18ngrep "Refusing to lose dirty file at other.c" out &&
+ test_path_is_file other.c~HEAD &&
+ test $(git hash-object other.c~HEAD) = $(git rev-parse c1a:c1.c) &&
+ test_cmp important other.c
+ fi
'
test_expect_success 'will not overwrite untracked subtree' '