Skip sleep and retry if git remote update exits with a signal

Pressing ctrl-c during repo sync often hangs for 30 to 45 seconds
due to the time.sleep and retry in _RemoteFetch.  If git exits with
a signal, for example -2 for SIGINT triggered by ctrl-c, skip the
sleep and retry.

Change-Id: I32da12c2dcc96d9cc0b12a066e824b12ebfb52a0
This commit is contained in:
Colin Cross 2015-05-13 00:10:02 -07:00
parent 31a7be561e
commit c4b301f988

View File

@ -1908,6 +1908,9 @@ class Project(object):
# mode, we just tried sync'ing from the upstream field; it doesn't exist, thus # mode, we just tried sync'ing from the upstream field; it doesn't exist, thus
# abort the optimization attempt and do a full sync. # abort the optimization attempt and do a full sync.
break break
elif ret < 0:
# Git died with a signal, exit immediately
break
time.sleep(random.randint(30, 45)) time.sleep(random.randint(30, 45))
if initial: if initial: