mirror of
https://chromium.googlesource.com/chromium/tools/depot_tools.git
synced 2026-01-11 18:51:29 +00:00
fail gracefully if git footers is called in cog
Bug: 339231299 Change-Id: Ibfe871ec37db42f2ad75b3effc142f5854d878be Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5539335 Commit-Queue: Josip Sokcevic <sokcevic@chromium.org> Reviewed-by: Josip Sokcevic <sokcevic@chromium.org> Auto-Submit: Yiwei Zhang <yiwzhang@google.com>
This commit is contained in:
@@ -10,6 +10,7 @@ import sys
|
||||
|
||||
from collections import defaultdict
|
||||
|
||||
import gclient_utils
|
||||
import git_common as git
|
||||
|
||||
FOOTER_PATTERN = re.compile(r'^\s*([\w-]+): *(.*)$')
|
||||
@@ -212,6 +213,10 @@ def get_position(footers):
|
||||
|
||||
|
||||
def main(args):
|
||||
if gclient_utils.IsEnvCog():
|
||||
print('footers command is not supported in non-git environment',
|
||||
file=sys.stderr)
|
||||
return 1
|
||||
parser = argparse.ArgumentParser(
|
||||
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
|
||||
parser.add_argument('ref',
|
||||
|
||||
Reference in New Issue
Block a user