diff options
author | Mike Frysinger <vapier@google.com> | 2022-08-18 09:17:09 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@google.com> | 2022-08-18 16:43:39 +0000 |
commit | ad1b7bd2e2d4fb636bef03d4b056b2f9de1fbf19 (patch) | |
tree | 787415940af619b5ac01675f16d58afdb3f184f5 /project.py | |
parent | 3c2d807905b5386d0308a5687442162e1075f4ae (diff) | |
download | git-repo-ad1b7bd2e2d4fb636bef03d4b056b2f9de1fbf19.tar.gz |
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>
Diffstat (limited to 'project.py')
-rw-r--r-- | project.py | 10 |
1 files changed, 2 insertions, 8 deletions
@@ -1678,10 +1678,7 @@ class Project(object): | |||
1678 | 1678 | ||
1679 | all_refs = self.bare_ref.all | 1679 | all_refs = self.bare_ref.all |
1680 | if R_HEADS + name in all_refs: | 1680 | if R_HEADS + name in all_refs: |
1681 | return GitCommand(self, | 1681 | return GitCommand(self, ['checkout', '-q', name, '--']).Wait() == 0 |
1682 | ['checkout', name, '--'], | ||
1683 | capture_stdout=True, | ||
1684 | capture_stderr=True).Wait() == 0 | ||
1685 | 1682 | ||
1686 | branch = self.GetBranch(name) | 1683 | branch = self.GetBranch(name) |
1687 | branch.remote = self.GetRemote() | 1684 | branch.remote = self.GetRemote() |
@@ -1706,10 +1703,7 @@ class Project(object): | |||
1706 | branch.Save() | 1703 | branch.Save() |
1707 | return True | 1704 | return True |
1708 | 1705 | ||
1709 | if GitCommand(self, | 1706 | if GitCommand(self, ['checkout', '-q', '-b', branch.name, revid]).Wait() == 0: |
1710 | ['checkout', '-b', branch.name, revid], | ||
1711 | capture_stdout=True, | ||
1712 | capture_stderr=True).Wait() == 0: | ||
1713 | branch.Save() | 1707 | branch.Save() |
1714 | return True | 1708 | return True |
1715 | return False | 1709 | return False |