[PATCH 3/3] t3034: test deprecated interface

2016-02-23 Thread Felipe Gonçalves Assis
From: Felipe Gonçalves Assis 

--find-renames= and --rename-threshold= should be aliases.

Signed-off-by: Felipe Gonçalves Assis 
---
 t/t3034-merge-recursive-rename-options.sh | 46 +++
 1 file changed, 46 insertions(+)

diff --git a/t/t3034-merge-recursive-rename-options.sh 
b/t/t3034-merge-recursive-rename-options.sh
index c07a4cb..96d8767 100755
--- a/t/t3034-merge-recursive-rename-options.sh
+++ b/t/t3034-merge-recursive-rename-options.sh
@@ -260,4 +260,50 @@ test_expect_success '--find-renames rejects non-numbers' '
git diff --quiet --cached
 '
 
+test_expect_success 'rename-threshold= is a synonym for find-renames=' '
+   git read-tree --reset -u HEAD &&
+   test_must_fail git merge-recursive --rename-threshold=$th0 $tail &&
+   check_threshold_0
+'
+
+test_expect_success 'last wins in --no-renames --rename-threshold=' '
+   git read-tree --reset -u HEAD &&
+   test_must_fail git merge-recursive --no-renames --rename-threshold=$th0 
$tail &&
+   check_threshold_0
+'
+
+test_expect_success 'last wins in --rename-threshold= --no-renames' '
+   git read-tree --reset -u HEAD &&
+   git merge-recursive --rename-threshold=$th0 --no-renames $tail &&
+   check_no_renames
+'
+
+test_expect_success '--rename-threshold= rejects negative argument' '
+   git read-tree --reset -u HEAD &&
+   test_must_fail git merge-recursive --rename-threshold=-25 \
+   HEAD -- HEAD HEAD &&
+   git diff --quiet --cached
+'
+
+test_expect_success '--rename-threshold= rejects non-numbers' '
+   git read-tree --reset -u HEAD &&
+   test_must_fail git merge-recursive --rename-threshold=0xf \
+   HEAD -- HEAD HEAD &&
+   git diff --quiet --cached
+'
+
+test_expect_success 'last wins in --rename-threshold= --find-renames=' '
+   git read-tree --reset -u HEAD &&
+   test_must_fail git merge-recursive \
+   --rename-threshold=$th0 --find-renames=$th2 $tail &&
+   check_threshold_2
+'
+
+test_expect_success 'last wins in --find-renames= --rename-threshold=' '
+   git read-tree --reset -u HEAD &&
+   test_must_fail git merge-recursive \
+   --find-renames=$th2 --rename-threshold=$th0 $tail &&
+   check_threshold_0
+'
+
 test_done
-- 
2.7.1.492.gd821b20

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[PATCH 3/3] t3034: test deprecated interface

2016-02-22 Thread Felipe Gonçalves Assis
--find-renames= and --rename-threshold= should be aliases.

Signed-off-by: Felipe Gonçalves Assis 
---
 t/t3034-merge-recursive-rename-options.sh | 46 +++
 1 file changed, 46 insertions(+)

diff --git a/t/t3034-merge-recursive-rename-options.sh 
b/t/t3034-merge-recursive-rename-options.sh
index 03ce77c..59599ec 100755
--- a/t/t3034-merge-recursive-rename-options.sh
+++ b/t/t3034-merge-recursive-rename-options.sh
@@ -260,4 +260,50 @@ test_expect_success '--find-renames rejects non-numbers' '
git diff --quiet --cached
 '
 
+test_expect_success 'rename-threshold= is a synonym for find-renames=' '
+   git read-tree --reset -u HEAD &&
+   test_must_fail git merge-recursive --rename-threshold=${th[0]} $tail &&
+   check_threshold_0
+'
+
+test_expect_success 'last wins in --no-renames --rename-threshold=' '
+   git read-tree --reset -u HEAD &&
+   test_must_fail git merge-recursive --no-renames 
--rename-threshold=${th[0]} $tail &&
+   check_threshold_0
+'
+
+test_expect_success 'last wins in --rename-threshold= --no-renames' '
+   git read-tree --reset -u HEAD &&
+   git merge-recursive --rename-threshold=${th[0]} --no-renames $tail &&
+   check_no_renames
+'
+
+test_expect_success '--rename-threshold= rejects negative argument' '
+   git read-tree --reset -u HEAD &&
+   test_must_fail git merge-recursive --rename-threshold=-${th[0]} \
+   HEAD -- HEAD HEAD &&
+   git diff --quiet --cached
+'
+
+test_expect_success '--rename-threshold= rejects non-numbers' '
+   git read-tree --reset -u HEAD &&
+   test_must_fail git merge-recursive --rename-threshold=0xf \
+   HEAD -- HEAD HEAD &&
+   git diff --quiet --cached
+'
+
+test_expect_success 'last wins in --rename-threshold= --find-renames=' '
+   git read-tree --reset -u HEAD &&
+   test_must_fail git merge-recursive \
+   --rename-threshold=${th[0]} --find-renames=${th[2]} $tail &&
+   check_threshold_2
+'
+
+test_expect_success 'last wins in --find-renames= --rename-threshold=' '
+   git read-tree --reset -u HEAD &&
+   test_must_fail git merge-recursive \
+   --find-renames=${th[2]} --rename-threshold=${th[0]} $tail &&
+   check_threshold_0
+'
+
 test_done
-- 
2.7.1.492.gd821b20

--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html