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>
This commit is contained in:
Shawn O. Pearce 2008-10-28 16:12:03 -07:00
parent 45476c40c7
commit ce03a401c6

View File

@ -762,41 +762,9 @@ class Project(object):
def _RemoteFetch(self, name=None): def _RemoteFetch(self, name=None):
if not name: if not name:
name = self.remote.name name = self.remote.name
return GitCommand(self,
hide_errors = False
if self.extraRemotes or self.snapshots:
hide_errors = True
proc = GitCommand(self,
['fetch', name], ['fetch', name],
bare = True, bare = True).Wait() == 0
capture_stderr = hide_errors)
if hide_errors:
err = proc.process.stderr.fileno()
buf = ''
while True:
b = os.read(err, 256)
if b:
buf += b
while buf:
r = buf.find('remote: error: unable to find ')
if r >= 0:
lf = buf.find('\n')
if lf < 0:
break
buf = buf[lf + 1:]
continue
cr = buf.find('\r')
if cr < 0:
break
os.write(2, buf[0:cr + 1])
buf = buf[cr + 1:]
if not b:
if buf:
os.write(2, buf)
break
return proc.Wait() == 0
def _Checkout(self, rev, quiet=False): def _Checkout(self, rev, quiet=False):
cmd = ['checkout'] cmd = ['checkout']