mirror of
https://gerrit.googlesource.com/git-repo
synced 2025-06-26 20:17:52 +00:00
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>
This commit is contained in:
22
project.py
22
project.py
@ -2003,8 +2003,8 @@ class Project(object):
|
||||
name: The name of the branch to abandon.
|
||||
|
||||
Returns:
|
||||
True if the abandon succeeded; False if it didn't; None if the
|
||||
branch didn't exist.
|
||||
True if the abandon succeeded; Raises GitCommandError if it didn't;
|
||||
None if the branch didn't exist.
|
||||
"""
|
||||
rev = R_HEADS + name
|
||||
all_refs = self.bare_ref.all
|
||||
@ -2025,16 +2025,14 @@ class Project(object):
|
||||
)
|
||||
else:
|
||||
self._Checkout(revid, quiet=True)
|
||||
|
||||
return (
|
||||
GitCommand(
|
||||
self,
|
||||
["branch", "-D", name],
|
||||
capture_stdout=True,
|
||||
capture_stderr=True,
|
||||
).Wait()
|
||||
== 0
|
||||
)
|
||||
GitCommand(
|
||||
self,
|
||||
["branch", "-D", name],
|
||||
capture_stdout=True,
|
||||
capture_stderr=True,
|
||||
verify_command=True,
|
||||
).Wait()
|
||||
return True
|
||||
|
||||
def PruneHeads(self):
|
||||
"""Prune any topic branches already merged into upstream."""
|
||||
|
Reference in New Issue
Block a user