aboutsummaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorFelipe Gonçalves Assis <felipeg.assis@gmail.com>2016-02-23 22:41:30 -0300
committerJunio C Hamano <gitster@pobox.com>2016-02-24 14:48:34 -0800
commit2307211349e6fe83e3574c2e1a03bb34c24ed1b9 (patch)
treed6b7074798aa8c1e876b5b921961a59274aa5082 /t
parent63651e1a13f29abcffb1d197f3388924318d59d3 (diff)
downloadgit-2307211349e6fe83e3574c2e1a03bb34c24ed1b9.tar.gz
git-2307211349e6fe83e3574c2e1a03bb34c24ed1b9.tar.xz
t3034: test option to disable renames
Signed-off-by: Felipe Gonçalves Assis <felipegassis@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t3034-merge-recursive-rename-options.sh28
1 files changed, 28 insertions, 0 deletions
diff --git a/t/t3034-merge-recursive-rename-options.sh b/t/t3034-merge-recursive-rename-options.sh
index 51c2f8720..247991034 100755
--- a/t/t3034-merge-recursive-rename-options.sh
+++ b/t/t3034-merge-recursive-rename-options.sh
@@ -83,6 +83,14 @@ check_exact_renames () {
rename_detected 3
}
+check_no_renames () {
+ check_common &&
+ rename_undetected 0 &&
+ rename_undetected 1 &&
+ rename_undetected 2 &&
+ rename_undetected 3
+}
+
test_expect_success 'setup repo' '
cat <<-\EOF >3-old &&
33a
@@ -195,6 +203,12 @@ test_expect_success 'rename threshold is truncated' '
check_exact_renames
'
+test_expect_success 'disabled rename detection' '
+ git read-tree --reset -u HEAD &&
+ git merge-recursive --no-renames $tail &&
+ check_no_renames
+'
+
test_expect_success 'last wins in --find-renames=<m> --find-renames=<n>' '
git read-tree --reset -u HEAD &&
test_must_fail git merge-recursive \
@@ -209,6 +223,18 @@ test_expect_success '--find-renames resets threshold' '
$check_50
'
+test_expect_success 'last wins in --no-renames --find-renames' '
+ git read-tree --reset -u HEAD &&
+ test_must_fail git merge-recursive --no-renames --find-renames $tail &&
+ $check_50
+'
+
+test_expect_success 'last wins in --find-renames --no-renames' '
+ git read-tree --reset -u HEAD &&
+ git merge-recursive --find-renames --no-renames $tail &&
+ check_no_renames
+'
+
test_expect_success 'assumption for further tests: trivial merge succeeds' '
git read-tree --reset -u HEAD &&
git merge-recursive HEAD -- HEAD HEAD &&
@@ -218,6 +244,8 @@ test_expect_success 'assumption for further tests: trivial merge succeeds' '
git merge-recursive --find-renames=$th2 HEAD -- HEAD HEAD &&
git diff --quiet --cached &&
git merge-recursive --find-renames=100% HEAD -- HEAD HEAD &&
+ git diff --quiet --cached &&
+ git merge-recursive --no-renames HEAD -- HEAD HEAD &&
git diff --quiet --cached
'