From 7ddd7cb5901bec14d2a5e7f88e07047b5216ad06 Mon Sep 17 00:00:00 2001 From: Randy Lai Date: Wed, 7 Mar 2018 15:29:18 -0500 Subject: [PATCH] Fix: use check-ref-format to check branch name validity --- core/commands/checkout.py | 15 +++++++-------- core/git_mixins/branches.py | 4 ++++ 2 files changed, 11 insertions(+), 8 deletions(-) diff --git a/core/commands/checkout.py b/core/commands/checkout.py index c425bc505..d234e9b81 100644 --- a/core/commands/checkout.py +++ b/core/commands/checkout.py @@ -1,16 +1,14 @@ -import re import sublime from sublime_plugin import WindowCommand from ..git_command import GitCommand +from ..exceptions import GitSavvyError from ...common import util from ..ui_mixins.quick_panel import show_branch_panel NEW_BRANCH_PROMPT = "Branch name:" NEW_BRANCH_INVALID = "`{}` is a invalid branch name.\nRead more on $(man git-check-ref-format)" -_is_valid_branch_name = re.compile( - r"^(?!\.|.*\.\..*|.*@.*|\/)[a-zA-Z0-9\-\_\/\.#\u263a-\U0001f645]+(?