mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 02:31:29 +00:00
fail gracefully if git rename-branch is called in cog
Bug: 339231299 Change-Id: If88eaa54c579b418516058b1285ce2eb5af6e474 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5540435 Auto-Submit: Yiwei Zhang <yiwzhang@google.com> Reviewed-by: Josip Sokcevic <sokcevic@chromium.org> Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
This commit is contained in:
@@ -12,8 +12,14 @@ import subprocess2
|
|||||||
from git_common import current_branch, run, set_branch_config, branch_config
|
from git_common import current_branch, run, set_branch_config, branch_config
|
||||||
from git_common import branch_config_map
|
from git_common import branch_config_map
|
||||||
|
|
||||||
|
import gclient_utils
|
||||||
|
|
||||||
|
|
||||||
def main(args):
|
def main(args):
|
||||||
|
if gclient_utils.IsEnvCog():
|
||||||
|
print('rename-branch command is not supported in non-git environment.',
|
||||||
|
file=sys.stderr)
|
||||||
|
return 1
|
||||||
current = current_branch()
|
current = current_branch()
|
||||||
if current == 'HEAD':
|
if current == 'HEAD':
|
||||||
current = None
|
current = None
|
||||||
|
|||||||
Reference in New Issue
Block a user