]> git.ipfire.org Git - thirdparty/git.git/blobdiff - t/t3200-branch.sh
branch: advise about ref syntax rules
[thirdparty/git.git] / t / t3200-branch.sh
index 060b27097e8a8fe19dc038e6c05505d58cb47999..dd7525d1b8c5023daba6cd24e33d943df94b9136 100755 (executable)
@@ -1722,4 +1722,14 @@ test_expect_success '--track overrides branch.autoSetupMerge' '
        test_cmp_config "" --default "" branch.foo5.merge
 '
 
+test_expect_success 'errors if given a bad branch name' '
+       cat <<-\EOF >expect &&
+       fatal: '\''foo..bar'\'' is not a valid branch name
+       hint: See `man git check-ref-format`
+       hint: Disable this message with "git config advice.refSyntax false"
+       EOF
+       test_must_fail git branch foo..bar >actual 2>&1 &&
+       test_cmp expect actual
+'
+
 test_done