summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2021-11-10 23:01:19 (GMT)
committerJunio C Hamano <gitster@pobox.com>2021-11-10 23:01:19 (GMT)
commit7c7cf62c485f527bee6d3eb7e37dcfbf8064cab2 (patch)
tree1ae588b26347be9651758ca0c3137245f07b0fef /t
parent6c220937e2b26d85920bf2d38ff2464a0d57fd6b (diff)
parent361cb52383fb986f76a34506bdec9a1dd11133f0 (diff)
downloadgit-7c7cf62c485f527bee6d3eb7e37dcfbf8064cab2.zip
git-7c7cf62c485f527bee6d3eb7e37dcfbf8064cab2.tar.gz
git-7c7cf62c485f527bee6d3eb7e37dcfbf8064cab2.tar.bz2
Merge branch 'jc/fix-pull-ff-only-when-already-up-to-date'
"git pull --ff-only" and "git pull --rebase --ff-only" should make it a no-op to attempt pulling from a remote that is behind us, but instead the command errored out by saying it was impossible to fast-forward, which may technically be true, but not a useful thing to diagnose as an error. This has been corrected. * jc/fix-pull-ff-only-when-already-up-to-date: pull: --ff-only should make it a noop when already-up-to-date
Diffstat (limited to 't')
-rwxr-xr-xt/t7601-merge-pull-config.sh16
1 files changed, 15 insertions, 1 deletions
diff --git a/t/t7601-merge-pull-config.sh b/t/t7601-merge-pull-config.sh
index 1f652f4..6275641 100755
--- a/t/t7601-merge-pull-config.sh
+++ b/t/t7601-merge-pull-config.sh
@@ -2,7 +2,7 @@
test_description='git merge
-Testing pull.* configuration parsing.'
+Testing pull.* configuration parsing and other things.'
. ./test-lib.sh
@@ -387,6 +387,20 @@ test_expect_success 'pull prevents non-fast-forward with "only" in pull.ff' '
test_must_fail git pull . c3
'
+test_expect_success 'already-up-to-date pull succeeds with "only" in pull.ff' '
+ git reset --hard c1 &&
+ test_config pull.ff only &&
+ git pull . c0 &&
+ test "$(git rev-parse HEAD)" = "$(git rev-parse c1)"
+'
+
+test_expect_success 'already-up-to-date pull/rebase succeeds with "only" in pull.ff' '
+ git reset --hard c1 &&
+ test_config pull.ff only &&
+ git -c pull.rebase=true pull . c0 &&
+ test "$(git rev-parse HEAD)" = "$(git rev-parse c1)"
+'
+
test_expect_success 'merge c1 with c2 (ours in pull.twohead)' '
git reset --hard c1 &&
git config pull.twohead ours &&