t5520: reduce commom lines of code
These two tests are almost similar and thus can be folded in a for-loop. Helped-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Mehul Jain <mehul.jain2029@gmail.com> Reviewed-by: Eric Sunshine <sunshine@sunshineco.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Mehul Jain committed
Apr 2, 2016 at 23:28 UTC
16622979f8eaf864da5cf932d3d60de7c7d40d7d
1 file changed
+7
-9
t/t5520-pull.sh
+7
-9
@@ -298,15 +298,13 @@ test_expect_success 'pull --rebase --no-autostash & rebase.autostash unset' '
298
test_pull_autostash_fail --rebase --no-autostash
299
'
300
301
-test_expect_success 'pull --autostash (without --rebase) should error out' '
302
- test_must_fail git pull --autostash . copy 2>err &&
303
- test_i18ngrep "only valid with --rebase" err
304
-'
305
-
306
-test_expect_success 'pull --no-autostash (without --rebase) should error out' '
307
- test_must_fail git pull --no-autostash . copy 2>err &&
308
- test_i18ngrep "only valid with --rebase" err
309
-'
301
+for i in --autostash --no-autostash
302
+do
303
+ test_expect_success "pull $i (without --rebase) is illegal" '
304
+ test_must_fail git pull $i . copy 2>err &&
305
+ test_i18ngrep "only valid with --rebase" err
306
+ '
307
+done
308
309
test_expect_success 'pull.rebase' '
310
git reset --hard before-rebase &&