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)
344
344
if (!git_config_get_value ("pull.rebase" , & value ))
345
345
return parse_config_rebase ("pull.rebase" , value , 1 );
346
346
347
- if (opt_verbosity >= 0 &&
348
- (!opt_ff || strcmp (opt_ff , "--ff-only" ))) {
347
+ if (opt_verbosity >= 0 && !opt_ff ) {
349
348
warning (_ ("Pulling without specifying how to reconcile divergent branches is\n"
350
349
"discouraged. You can squelch this message by running one of the following\n"
351
350
"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' '
33
33
test_i18ngrep "Pulling without specifying how to reconcile" err
34
34
'
35
35
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
+
36
43
test_expect_success ' pull.rebase not set and pull.ff=false' '
37
44
git reset --hard c0 &&
38
45
test_config pull.ff false &&
39
46
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
41
48
'
42
49
43
50
test_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' '
59
66
test_i18ngrep ! "Pulling without specifying how to reconcile" err
60
67
'
61
68
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
+
62
81
test_expect_success ' pull.rebase not set and --ff-only given' '
63
82
git reset --hard c0 &&
64
83
git pull --ff-only . c1 2>err &&
You can’t perform that action at this time.
0 commit comments