diff --git a/git_new_branch.py b/git_new_branch.py index 3087588c98..545d8f9fc8 100755 --- a/git_new_branch.py +++ b/git_new_branch.py @@ -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__,