diff options
author | Shawn O. Pearce <sop@google.com> | 2008-10-28 16:12:03 -0700 |
---|---|---|
committer | Shawn O. Pearce <sop@google.com> | 2008-10-28 16:12:03 -0700 |
commit | ce03a401c6fb5a890a3fbf03ab51f70a80370ec1 (patch) | |
tree | c575afd365420dda631581dd3efc7a588a8c37a6 | |
parent | 45476c40c7300efe09ee376a8f1bf4488bd25afa (diff) | |
download | git-repo-ce03a401c6fb5a890a3fbf03ab51f70a80370ec1.tar.gz |
Stop hiding remote missing object errors
Hiding error messages from the remote peer is not a good idea,
as users should be made aware when the remote peer is not a
complete Git repository so they can alert the administrators
and have the repository corrected.
Signed-off-by: Shawn O. Pearce <sop@google.com>
-rw-r--r-- | project.py | 36 |
1 files changed, 2 insertions, 34 deletions
@@ -762,41 +762,9 @@ class Project(object): | |||
762 | def _RemoteFetch(self, name=None): | 762 | def _RemoteFetch(self, name=None): |
763 | if not name: | 763 | if not name: |
764 | name = self.remote.name | 764 | name = self.remote.name |
765 | 765 | return GitCommand(self, | |
766 | hide_errors = False | ||
767 | if self.extraRemotes or self.snapshots: | ||
768 | hide_errors = True | ||
769 | |||
770 | proc = GitCommand(self, | ||
771 | ['fetch', name], | 766 | ['fetch', name], |
772 | bare = True, | 767 | bare = True).Wait() == 0 |
773 | capture_stderr = hide_errors) | ||
774 | if hide_errors: | ||
775 | err = proc.process.stderr.fileno() | ||
776 | buf = '' | ||
777 | while True: | ||
778 | b = os.read(err, 256) | ||
779 | if b: | ||
780 | buf += b | ||
781 | while buf: | ||
782 | r = buf.find('remote: error: unable to find ') | ||
783 | if r >= 0: | ||
784 | lf = buf.find('\n') | ||
785 | if lf < 0: | ||
786 | break | ||
787 | buf = buf[lf + 1:] | ||
788 | continue | ||
789 | |||
790 | cr = buf.find('\r') | ||
791 | if cr < 0: | ||
792 | break | ||
793 | os.write(2, buf[0:cr + 1]) | ||
794 | buf = buf[cr + 1:] | ||
795 | if not b: | ||
796 | if buf: | ||
797 | os.write(2, buf) | ||
798 | break | ||
799 | return proc.Wait() == 0 | ||
800 | 768 | ||
801 | def _Checkout(self, rev, quiet=False): | 769 | def _Checkout(self, rev, quiet=False): |
802 | cmd = ['checkout'] | 770 | cmd = ['checkout'] |