File tree Expand file tree Collapse file tree 2 files changed +21
-3
lines changed
Expand file tree Collapse file tree 2 files changed +21
-3
lines changed Original file line number Diff line number Diff line change @@ -344,8 +344,7 @@ static enum rebase_type config_get_rebase(void)
344344 if (!git_config_get_value ("pull.rebase" , & value ))
345345 return parse_config_rebase ("pull.rebase" , value , 1 );
346346
347- if (opt_verbosity >= 0 &&
348- (!opt_ff || strcmp (opt_ff , "--ff-only" ))) {
347+ if (opt_verbosity >= 0 && !opt_ff ) {
349348 warning (_ ("Pulling without specifying how to reconcile divergent branches is\n"
350349 "discouraged. You can squelch this message by running one of the following\n"
351350 "commands sometime before your next pull:\n"
Original file line number Diff line number Diff line change @@ -33,11 +33,18 @@ test_expect_success 'pull.rebase not set' '
3333 test_i18ngrep "Pulling without specifying how to reconcile" err
3434'
3535
36+ test_expect_success ' pull.rebase not set and pull.ff=true' '
37+ git reset --hard c0 &&
38+ test_config pull.ff true &&
39+ git pull . c1 2>err &&
40+ test_i18ngrep ! "Pulling without specifying how to reconcile" err
41+ '
42+
3643test_expect_success ' pull.rebase not set and pull.ff=false' '
3744 git reset --hard c0 &&
3845 test_config pull.ff false &&
3946 git pull . c1 2>err &&
40- test_i18ngrep "Pulling without specifying how to reconcile" err
47+ test_i18ngrep ! "Pulling without specifying how to reconcile" err
4148'
4249
4350test_expect_success ' pull.rebase not set and pull.ff=only' '
@@ -59,6 +66,18 @@ test_expect_success 'pull.rebase not set and --no-rebase given' '
5966 test_i18ngrep ! "Pulling without specifying how to reconcile" err
6067'
6168
69+ test_expect_success ' pull.rebase not set and --ff given' '
70+ git reset --hard c0 &&
71+ git pull --ff . c1 2>err &&
72+ test_i18ngrep ! "Pulling without specifying how to reconcile" err
73+ '
74+
75+ test_expect_success ' pull.rebase not set and --no-ff given' '
76+ git reset --hard c0 &&
77+ git pull --no-ff . c1 2>err &&
78+ test_i18ngrep ! "Pulling without specifying how to reconcile" err
79+ '
80+
6281test_expect_success ' pull.rebase not set and --ff-only given' '
6382 git reset --hard c0 &&
6483 git pull --ff-only . c1 2>err &&
You can’t perform that action at this time.
0 commit comments