t3034: test deprecated interface
--find-renames= and --rename-threshold= should be aliases. Signed-off-by: Felipe Gonçalves Assis <felipegassis@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Felipe Gonçalves Assis committed
Feb 23, 2016 at 22:41 UTC
44c74ecade186d7c7047642840d581709db3ba23
1 file changed
+46
t/t3034-merge-recursive-rename-options.sh
+46
@@ -263,4 +263,50 @@ test_expect_success '--find-renames rejects non-numbers' '
263
git diff --quiet --cached
264
'
265
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
+
312
test_done