Skip to content

Commit

Permalink
t5520: reduce commom lines of code
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
mehul2029 authored and gitster committed Apr 4, 2016
1 parent 44a59ff commit 1662297
Showing 1 changed file with 7 additions and 9 deletions.
16 changes: 7 additions & 9 deletions t/t5520-pull.sh
Original file line number Diff line number Diff line change
Expand Up @@ -298,15 +298,13 @@ test_expect_success 'pull --rebase --no-autostash & rebase.autostash unset' '
test_pull_autostash_fail --rebase --no-autostash
'

test_expect_success 'pull --autostash (without --rebase) should error out' '
test_must_fail git pull --autostash . copy 2>err &&
test_i18ngrep "only valid with --rebase" err
'

test_expect_success 'pull --no-autostash (without --rebase) should error out' '
test_must_fail git pull --no-autostash . copy 2>err &&
test_i18ngrep "only valid with --rebase" err
'
for i in --autostash --no-autostash
do
test_expect_success "pull $i (without --rebase) is illegal" '
test_must_fail git pull $i . copy 2>err &&
test_i18ngrep "only valid with --rebase" err
'
done

test_expect_success 'pull.rebase' '
git reset --hard before-rebase &&
Expand Down

0 comments on commit 1662297

Please sign in to comment.