aboutsummaryrefslogtreecommitdiffstats
path: root/t
diff options
context:
space:
mode:
authorElijah Newren <newren@gmail.com>2023-01-25 04:03:54 +0000
committerJunio C Hamano <gitster@pobox.com>2023-01-25 09:20:53 -0800
commiteddfcd8eced9b9f840491064b35a3956f959fd12 (patch)
tree84990d250d650d3fa0c630b7524d0ed911fe2ea9 /t
parentrebase: put rebase_options initialization in single place (diff)
downloadgit-eddfcd8eced9b9f840491064b35a3956f959fd12.tar.gz
git-eddfcd8eced9b9f840491064b35a3956f959fd12.zip
rebase: provide better error message for apply options vs. merge config
When config which selects the merge backend (currently, rebase.autosquash=true or rebase.updateRefs=true) conflicts with other options on the command line (such as --whitespace=fix), make the error message specifically call out the config option and specify how to override that config option on the command line. Signed-off-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rwxr-xr-xt/t3422-rebase-incompatible-options.sh24
1 files changed, 24 insertions, 0 deletions
diff --git a/t/t3422-rebase-incompatible-options.sh b/t/t3422-rebase-incompatible-options.sh
index 6a17b571ec..4711b37a28 100755
--- a/t/t3422-rebase-incompatible-options.sh
+++ b/t/t3422-rebase-incompatible-options.sh
@@ -94,6 +94,30 @@ test_rebase_am_only () {
git checkout B^0 &&
test_must_fail git rebase $opt --root A
"
+
+ test_expect_success "$opt incompatible with rebase.autosquash" "
+ git checkout B^0 &&
+ test_must_fail git -c rebase.autosquash=true rebase $opt A 2>err &&
+ grep -e --no-autosquash err
+ "
+
+ test_expect_success "$opt incompatible with rebase.updateRefs" "
+ git checkout B^0 &&
+ test_must_fail git -c rebase.updateRefs=true rebase $opt A 2>err &&
+ grep -e --no-update-refs err
+ "
+
+ test_expect_success "$opt okay with overridden rebase.autosquash" "
+ test_when_finished \"git reset --hard B^0\" &&
+ git checkout B^0 &&
+ git -c rebase.autosquash=true rebase --no-autosquash $opt A
+ "
+
+ test_expect_success "$opt okay with overridden rebase.updateRefs" "
+ test_when_finished \"git reset --hard B^0\" &&
+ git checkout B^0 &&
+ git -c rebase.updateRefs=true rebase --no-update-refs $opt A
+ "
}
# Check options which imply --apply