summaryrefslogtreecommitdiffstats
path: root/project.py
diff options
context:
space:
mode:
authorJason Chang <jasonnc@google.com>2023-08-03 14:38:00 -0700
committerLUCI <gerrit-scoped@luci-project-accounts.iam.gserviceaccount.com>2023-08-07 23:56:07 +0000
commitf9aacd4087b02948da9a7878da48ea186ab99d5a (patch)
treeb683190635cd6fcb7cf817837ad0c4259b53078f /project.py
parentb8a7b4a629c3435d77a3266a4e6dce51dc342bd9 (diff)
downloadgit-repo-f9aacd4087b02948da9a7878da48ea186ab99d5a.tar.gz
Raise repo exit errors in place of sys.exit
Bug: b/293344017 Change-Id: I92d81c78eba8ff31b5252415f4c9a515a6c76411 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/381774 Tested-by: Jason Chang <jasonnc@google.com> Reviewed-by: Joanna Wang <jojwang@google.com> Commit-Queue: Jason Chang <jasonnc@google.com>
Diffstat (limited to 'project.py')
-rw-r--r--project.py22
1 files changed, 10 insertions, 12 deletions
diff --git a/project.py b/project.py
index b268007d..c3eb09c9 100644
--- a/project.py
+++ b/project.py
@@ -2003,8 +2003,8 @@ class Project(object):
2003 name: The name of the branch to abandon. 2003 name: The name of the branch to abandon.
2004 2004
2005 Returns: 2005 Returns:
2006 True if the abandon succeeded; False if it didn't; None if the 2006 True if the abandon succeeded; Raises GitCommandError if it didn't;
2007 branch didn't exist. 2007 None if the branch didn't exist.
2008 """ 2008 """
2009 rev = R_HEADS + name 2009 rev = R_HEADS + name
2010 all_refs = self.bare_ref.all 2010 all_refs = self.bare_ref.all
@@ -2025,16 +2025,14 @@ class Project(object):
2025 ) 2025 )
2026 else: 2026 else:
2027 self._Checkout(revid, quiet=True) 2027 self._Checkout(revid, quiet=True)
2028 2028 GitCommand(
2029 return ( 2029 self,
2030 GitCommand( 2030 ["branch", "-D", name],
2031 self, 2031 capture_stdout=True,
2032 ["branch", "-D", name], 2032 capture_stderr=True,
2033 capture_stdout=True, 2033 verify_command=True,
2034 capture_stderr=True, 2034 ).Wait()
2035 ).Wait() 2035 return True
2036 == 0
2037 )
2038 2036
2039 def PruneHeads(self): 2037 def PruneHeads(self):
2040 """Prune any topic branches already merged into upstream.""" 2038 """Prune any topic branches already merged into upstream."""