Skip to content

Commit 22a1ae6

Browse files
committed
Merge branch 'pt/pull-ff-vs-merge-ff'
The pull.ff configuration was supposed to override the merge.ff configuration, but it didn't. * pt/pull-ff-vs-merge-ff: pull: parse pull.ff as a bool or string pull: make pull.ff=true override merge.ff
2 parents 1423058 + db9bb28 commit 22a1ae6

File tree

3 files changed

+13
-2
lines changed

3 files changed

+13
-2
lines changed

Documentation/config.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2061,7 +2061,7 @@ pull.ff::
20612061
a case (equivalent to giving the `--no-ff` option from the command
20622062
line). When set to `only`, only such fast-forward merges are
20632063
allowed (equivalent to giving the `--ff-only` option from the
2064-
command line).
2064+
command line). This setting overrides `merge.ff` when pulling.
20652065

20662066
pull.rebase::
20672067
When true, rebase branches on top of the fetched branch, instead

git-pull.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -54,8 +54,11 @@ then
5454
fi
5555

5656
# Setup default fast-forward options via `pull.ff`
57-
pull_ff=$(git config pull.ff)
57+
pull_ff=$(bool_or_string_config pull.ff)
5858
case "$pull_ff" in
59+
true)
60+
no_ff=--ff
61+
;;
5962
false)
6063
no_ff=--no-ff
6164
;;

t/t7601-merge-pull-config.sh

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,14 @@ test_expect_success 'fast-forward pull succeeds with "true" in pull.ff' '
4545
test "$(git rev-parse HEAD)" = "$(git rev-parse c1)"
4646
'
4747

48+
test_expect_success 'pull.ff=true overrides merge.ff=false' '
49+
git reset --hard c0 &&
50+
test_config merge.ff false &&
51+
test_config pull.ff true &&
52+
git pull . c1 &&
53+
test "$(git rev-parse HEAD)" = "$(git rev-parse c1)"
54+
'
55+
4856
test_expect_success 'fast-forward pull creates merge with "false" in pull.ff' '
4957
git reset --hard c0 &&
5058
test_config pull.ff false &&

0 commit comments

Comments
 (0)