[PATCH] test: pull: add test for disabling pull.ff=only

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The advice clearly says it should be possible to override pull.ff=only
with --rebase:

  You can also pass --rebase, --no-rebase, or --ff-only on the command
  line to override the configured default per invocation.

Since the intended behavior of `git pull` is very easily forgotten let's
add a test to make sure it isn't.

Signed-off-by: Felipe Contreras <felipe.contreras@xxxxxxxxx>
---
 t/t7601-merge-pull-config.sh | 6 ++++++
 1 file changed, 6 insertions(+)

diff --git a/t/t7601-merge-pull-config.sh b/t/t7601-merge-pull-config.sh
index 52e8ccc933..72164593fd 100755
--- a/t/t7601-merge-pull-config.sh
+++ b/t/t7601-merge-pull-config.sh
@@ -183,6 +183,12 @@ test_expect_success 'pull prevents non-fast-forward with "only" in pull.ff' '
 	test_must_fail git pull . c3
 '
 
+test_expect_success 'pull allows non-fast-forward with "only" in pull.ff if --rebase' '
+	git reset --hard c1 &&
+	test_config pull.ff only &&
+	git pull --rebase . c3
+'
+
 test_expect_success 'merge c1 with c2 (ours in pull.twohead)' '
 	git reset --hard c1 &&
 	git config pull.twohead ours &&
-- 
2.32.0.172.gaf9b24eeb1




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux