@@ -1044,7 +1044,7 @@ int cmd_pull(int argc, const char **argv, const char *prefix)
can_ff = get_can_ff(&orig_head, &merge_heads.oid[0]);
- if (!opt_rebase && !opt_ff && !can_ff) {
+ if (!opt_rebase && !can_ff) {
if (opt_verbosity >= 0)
show_advice_pull_non_ff();
}
@@ -96,21 +96,21 @@ test_expect_success 'pull.rebase not set and pull.ff=true (not-fast-forward)' '
git reset --hard c2 &&
test_config pull.ff true &&
git pull . c1 2>err &&
- test_i18ngrep ! "Pulling without specifying how to reconcile" err
+ test_i18ngrep "Pulling without specifying how to reconcile" err
'
test_expect_success 'pull.rebase not set and pull.ff=false (not-fast-forward)' '
git reset --hard c2 &&
test_config pull.ff false &&
git pull . c1 2>err &&
- test_i18ngrep ! "Pulling without specifying how to reconcile" err
+ test_i18ngrep "Pulling without specifying how to reconcile" err
'
test_expect_success 'pull.rebase not set and pull.ff=only (not-fast-forward)' '
git reset --hard c2 &&
test_config pull.ff only &&
test_must_fail git pull . c1 2>err &&
- test_i18ngrep ! "Pulling without specifying how to reconcile" err
+ test_i18ngrep "Pulling without specifying how to reconcile" err
'
test_expect_success 'pull.rebase not set and --rebase given (not-fast-forward)' '
@@ -128,19 +128,19 @@ test_expect_success 'pull.rebase not set and --merge given (not-fast-forward)' '
test_expect_success 'pull.rebase not set and --ff given (not-fast-forward)' '
git reset --hard c2 &&
git pull --ff . c1 2>err &&
- test_i18ngrep ! "Pulling without specifying how to reconcile" err
+ test_i18ngrep "Pulling without specifying how to reconcile" err
'
test_expect_success 'pull.rebase not set and --no-ff given (not-fast-forward)' '
git reset --hard c2 &&
git pull --no-ff . c1 2>err &&
- test_i18ngrep ! "Pulling without specifying how to reconcile" err
+ test_i18ngrep "Pulling without specifying how to reconcile" err
'
test_expect_success 'pull.rebase not set and --ff-only given (not-fast-forward)' '
git reset --hard c2 &&
test_must_fail git pull --ff-only . c1 2>err &&
- test_i18ngrep ! "Pulling without specifying how to reconcile" err
+ test_i18ngrep "Pulling without specifying how to reconcile" err
'
test_expect_success 'merge c1 with c2' '
We want the user to specify either --merge or --rebase, if she doesn't we throw a warning. Using --ff, --no-ff, or --ff-only does not make the merge explicit. For example, if the user has the following configuration: git config pull.rebase true git pull --no-ff A merge is not implied. We should be consistent and either imply a merge; in which case a previous "pull.rebase=true" configuration is overridden, or don't; in which case the warning should be thrown. Cc: Junio C Hamano <gitster@pobox.com> Signed-off-by: Felipe Contreras <felipe.contreras@gmail.com> --- builtin/pull.c | 2 +- t/t7601-merge-pull-config.sh | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-)