start: do not swallow git output all the time
Normally git produces no output when creating or switching branches.
If there's a problem though, we want to show that to the user. So
switch from capturing all output to running in quiet mode.
Bug: https://crbug.com/gerrit/15819
Change-Id: I7873ecc7c3bacce591899cc9471cb0244eb74541
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/343454
Reviewed-by: LaMont Jones <lamontjones@google.com>
Tested-by: Mike Frysinger <vapier@google.com>
diff --git a/project.py b/project.py
index 4bf1eca..894fb38 100644
--- a/project.py
+++ b/project.py
@@ -1678,10 +1678,7 @@
all_refs = self.bare_ref.all
if R_HEADS + name in all_refs:
- return GitCommand(self,
- ['checkout', name, '--'],
- capture_stdout=True,
- capture_stderr=True).Wait() == 0
+ return GitCommand(self, ['checkout', '-q', name, '--']).Wait() == 0
branch = self.GetBranch(name)
branch.remote = self.GetRemote()
@@ -1706,10 +1703,7 @@
branch.Save()
return True
- if GitCommand(self,
- ['checkout', '-b', branch.name, revid],
- capture_stdout=True,
- capture_stderr=True).Wait() == 0:
+ if GitCommand(self, ['checkout', '-q', '-b', branch.name, revid]).Wait() == 0:
branch.Save()
return True
return False