From c4b301f988ad7499257538070f78f5e50e61b3ae Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Wed, 13 May 2015 00:10:02 -0700 Subject: [PATCH] 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 --- project.py | 3 +++ 1 file changed, 3 insertions(+) diff --git a/project.py b/project.py index 00e41ada..a41d26a8 100644 --- a/project.py +++ b/project.py @@ -1908,6 +1908,9 @@ class Project(object): # mode, we just tried sync'ing from the upstream field; it doesn't exist, thus # abort the optimization attempt and do a full sync. break + elif ret < 0: + # Git died with a signal, exit immediately + break time.sleep(random.randint(30, 45)) if initial: