From 56edc1d23df5c72021b74dcabe6b8b05abe5643a Mon Sep 17 00:00:00 2001 From: Yiwei Zhang Date: Wed, 15 May 2024 21:32:01 +0000 Subject: [PATCH] fail gracefully if git squash-branch is called in cog Bug: 339231299 Change-Id: If343481d12cd3763897b8fc695d3607cc4d7f64f Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5540931 Reviewed-by: Josip Sokcevic Auto-Submit: Yiwei Zhang Commit-Queue: Josip Sokcevic --- git_squash_branch.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/git_squash_branch.py b/git_squash_branch.py index 7f5444385..761a71c7d 100755 --- a/git_squash_branch.py +++ b/git_squash_branch.py @@ -6,10 +6,15 @@ import argparse import sys +import gclient_utils import git_common def main(args): + if gclient_utils.IsEnvCog(): + print('squash-branch command is not supported in non-git environment.', + file=sys.stderr) + return 1 parser = argparse.ArgumentParser() parser.add_argument( '-m',