fail gracefully if git new-branch is called in cog

Bug: 339231299
Change-Id: I21084c12815c82f7c0a90b5755de4d5551b6d94d
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5540434
Auto-Submit: Yiwei Zhang <yiwzhang@google.com>
Commit-Queue: Josip Sokcevic <sokcevic@chromium.org>
Reviewed-by: Josip Sokcevic <sokcevic@chromium.org>
changes/34/5540434/2
Yiwei Zhang 2 years ago committed by LUCI CQ
parent 99cfa7555b
commit da41d62982

@ -9,6 +9,7 @@ Create new branch tracking origin HEAD by default.
import argparse
import sys
import gclient_utils
import git_common
import subprocess2
@ -52,6 +53,10 @@ def create_new_branch(branch_name,
def main(args):
if gclient_utils.IsEnvCog():
print('new-branch command is not supported in non-git environment.',
file=sys.stderr)
return 1
parser = argparse.ArgumentParser(
formatter_class=argparse.ArgumentDefaultsHelpFormatter,
description=__doc__,

Loading…
Cancel
Save