diff options
author | 2021-11-10 15:01:19 -0800 | |
---|---|---|
committer | 2021-11-10 15:01:19 -0800 | |
commit | 7c7cf62c485f527bee6d3eb7e37dcfbf8064cab2 (patch) | |
tree | 1ae588b26347be9651758ca0c3137245f07b0fef /t | |
parent | Git 2.34-rc2 (diff) | |
parent | pull: --ff-only should make it a noop when already-up-to-date (diff) | |
download | tgif-7c7cf62c485f527bee6d3eb7e37dcfbf8064cab2.tar.xz |
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-x | t/t7601-merge-pull-config.sh | 16 |
1 files changed, 15 insertions, 1 deletions
diff --git a/t/t7601-merge-pull-config.sh b/t/t7601-merge-pull-config.sh index 1f652f433e..6275641b9c 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 && |