summaryrefslogtreecommitdiffstats
path: root/project.py
diff options
context:
space:
mode:
authorColin Cross <ccross@android.com>2015-05-13 00:10:02 -0700
committerColin Cross <ccross@android.com>2015-05-13 18:11:34 +0000
commitc4b301f988ad7499257538070f78f5e50e61b3ae (patch)
treef19c83f4c06684361ffb2fec3028b34f89211a29 /project.py
parent31a7be561ef34c134447d92a3d391b17ecd7c790 (diff)
downloadgit-repo-c4b301f988ad7499257538070f78f5e50e61b3ae.tar.gz
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
Diffstat (limited to 'project.py')
-rw-r--r--project.py3
1 files changed, 3 insertions, 0 deletions
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):
1908 # mode, we just tried sync'ing from the upstream field; it doesn't exist, thus 1908 # mode, we just tried sync'ing from the upstream field; it doesn't exist, thus
1909 # abort the optimization attempt and do a full sync. 1909 # abort the optimization attempt and do a full sync.
1910 break 1910 break
1911 elif ret < 0:
1912 # Git died with a signal, exit immediately
1913 break
1911 time.sleep(random.randint(30, 45)) 1914 time.sleep(random.randint(30, 45))
1912 1915
1913 if initial: 1916 if initial: