From: Junio C Hamano Date: Mon, 30 Aug 2021 23:06:01 +0000 (-0700) Subject: Merge branch 'en/pull-conflicting-options' X-Git-Tag: v2.34.0-rc0~237 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=7d0daf3f12f87799a3b3f524933ef6c15d1f28c3;p=thirdparty%2Fgit.git Merge branch 'en/pull-conflicting-options' "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 --- 7d0daf3f12f87799a3b3f524933ef6c15d1f28c3 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