]> git.ipfire.org Git - thirdparty/git.git/blobdiff - git-checkout.sh
git-check-ref-format: reject funny ref names.
[thirdparty/git.git] / git-checkout.sh
index c3825904b60d36edca96506d7f451cf0349b262d..2c053a33c3c78f27150cdd397ad28641787abb3a 100755 (executable)
@@ -17,6 +17,8 @@ while [ "$#" != "0" ]; do
                        die "git checkout: -b needs a branch name"
                [ -e "$GIT_DIR/refs/heads/$newbranch" ] &&
                        die "git checkout: branch $newbranch already exists"
+               git-check-ref-format "heads/$newbranch" ||
+                       die "we do not like '$newbranch' as a branch name."
                ;;
        "-f")
                force=1