From: Junio C Hamano Date: Tue, 12 Oct 2021 20:51:36 +0000 (-0700) Subject: Merge branch 'en/pull-conflicting-options' into maint X-Git-Tag: v2.33.1~36 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b20f67a65939a9c8f43354d70ab6000f615d1804;p=thirdparty%2Fgit.git Merge branch 'en/pull-conflicting-options' into maint "git pull" had various corner cases that were not well thought out around its --rebase backend, e.g. "git pull --ff-only" did not stop but went ahead and rebased when the history on other side is not a descendant of our history. The series tries to fix them up. * en/pull-conflicting-options: pull: fix handling of multiple heads pull: update docs & code for option compatibility with rebasing pull: abort by default when fast-forwarding is not possible pull: make --rebase and --no-rebase override pull.ff=only pull: since --ff-only overrides, handle it first pull: abort if --ff-only is given and fast-forwarding is impossible t7601: add tests of interactions with multiple merge heads and config t7601: test interaction of merge/rebase/fast-forward flags and options --- b20f67a65939a9c8f43354d70ab6000f615d1804 diff --cc t/t6402-merge-rename.sh index 3da2896e3b,02a842697b..3a32b1a45c --- a/t/t6402-merge-rename.sh +++ b/t/t6402-merge-rename.sh @@@ -103,10 -103,12 +103,10 @@@ test_expect_success 'setup' test_expect_success 'pull renaming branch into unrenaming one' \ ' git show-branch && - test_expect_code 1 git pull . white && + test_expect_code 1 git pull --no-rebase . white && git ls-files -s && - git ls-files -u B >b.stages && - test_line_count = 3 b.stages && - git ls-files -s N >n.stages && - test_line_count = 1 n.stages && + test_stdout_line_count = 3 git ls-files -u B && + test_stdout_line_count = 1 git ls-files -s N && sed -ne "/^g/{ p q @@@ -119,9 -121,11 +119,9 @@@ test_expect_success 'pull renaming bran rm -f B && git reset --hard && git checkout red && - test_expect_code 1 git pull . white && + test_expect_code 1 git pull --no-rebase . white && - git ls-files -u B >b.stages && - test_line_count = 3 b.stages && - git ls-files -s N >n.stages && - test_line_count = 1 n.stages && + test_stdout_line_count = 3 git ls-files -u B && + test_stdout_line_count = 1 git ls-files -s N && sed -ne "/^g/{ p q @@@ -133,9 -137,11 +133,9 @@@ test_expect_success 'pull unrenaming br ' git reset --hard && git show-branch && - test_expect_code 1 git pull . main && + test_expect_code 1 git pull --no-rebase . main && - git ls-files -u B >b.stages && - test_line_count = 3 b.stages && - git ls-files -s N >n.stages && - test_line_count = 1 n.stages && + test_stdout_line_count = 3 git ls-files -u B && + test_stdout_line_count = 1 git ls-files -s N && sed -ne "/^g/{ p q @@@ -147,11 -153,15 +147,11 @@@ test_expect_success 'pull conflicting r ' git reset --hard && git show-branch && - test_expect_code 1 git pull . blue && + test_expect_code 1 git pull --no-rebase . blue && - git ls-files -u A >a.stages && - test_line_count = 1 a.stages && - git ls-files -u B >b.stages && - test_line_count = 1 b.stages && - git ls-files -u C >c.stages && - test_line_count = 1 c.stages && - git ls-files -s N >n.stages && - test_line_count = 1 n.stages && + test_stdout_line_count = 1 git ls-files -u A && + test_stdout_line_count = 1 git ls-files -u B && + test_stdout_line_count = 1 git ls-files -u C && + test_stdout_line_count = 1 git ls-files -s N && sed -ne "/^g/{ p q