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 &&
test new = "$(git show HEAD:file2)"
'
+test_expect_success 'pull --autostash & pull.rebase=true' '
+ test_config pull.rebase true &&
+ test_pull_autostash --autostash
+'
+
+test_expect_success 'pull --no-autostash & pull.rebase=true' '
+ test_config pull.rebase true &&
+ test_pull_autostash_fail --no-autostash
+'
+
test_expect_success 'branch.to-rebase.rebase' '
git reset --hard before-rebase &&
test_config branch.to-rebase.rebase true &&