Skip to content

Commit 44c74ec

Browse files
Felipe Gonçalves Assisgitster
authored andcommitted
t3034: test deprecated interface
--find-renames= and --rename-threshold= should be aliases. Signed-off-by: Felipe Gonçalves Assis <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 2307211 commit 44c74ec

File tree

1 file changed

+46
-0
lines changed

1 file changed

+46
-0
lines changed

t/t3034-merge-recursive-rename-options.sh

Lines changed: 46 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -263,4 +263,50 @@ test_expect_success '--find-renames rejects non-numbers' '
263263
git diff --quiet --cached
264264
'
265265

266+
test_expect_success 'rename-threshold=<n> is a synonym for find-renames=<n>' '
267+
git read-tree --reset -u HEAD &&
268+
test_must_fail git merge-recursive --rename-threshold=$th0 $tail &&
269+
check_threshold_0
270+
'
271+
272+
test_expect_success 'last wins in --no-renames --rename-threshold=<n>' '
273+
git read-tree --reset -u HEAD &&
274+
test_must_fail git merge-recursive --no-renames --rename-threshold=$th0 $tail &&
275+
check_threshold_0
276+
'
277+
278+
test_expect_success 'last wins in --rename-threshold=<n> --no-renames' '
279+
git read-tree --reset -u HEAD &&
280+
git merge-recursive --rename-threshold=$th0 --no-renames $tail &&
281+
check_no_renames
282+
'
283+
284+
test_expect_success '--rename-threshold=<n> rejects negative argument' '
285+
git read-tree --reset -u HEAD &&
286+
test_must_fail git merge-recursive --rename-threshold=-25 \
287+
HEAD -- HEAD HEAD &&
288+
git diff --quiet --cached
289+
'
290+
291+
test_expect_success '--rename-threshold=<n> rejects non-numbers' '
292+
git read-tree --reset -u HEAD &&
293+
test_must_fail git merge-recursive --rename-threshold=0xf \
294+
HEAD -- HEAD HEAD &&
295+
git diff --quiet --cached
296+
'
297+
298+
test_expect_success 'last wins in --rename-threshold=<m> --find-renames=<n>' '
299+
git read-tree --reset -u HEAD &&
300+
test_must_fail git merge-recursive \
301+
--rename-threshold=$th0 --find-renames=$th2 $tail &&
302+
check_threshold_2
303+
'
304+
305+
test_expect_success 'last wins in --find-renames=<m> --rename-threshold=<n>' '
306+
git read-tree --reset -u HEAD &&
307+
test_must_fail git merge-recursive \
308+
--find-renames=$th2 --rename-threshold=$th0 $tail &&
309+
check_threshold_0
310+
'
311+
266312
test_done

0 commit comments

Comments
 (0)