瀏覽代碼

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
Colin Cross 10 年之前
父節點
當前提交
c4b301f988
共有 1 個文件被更改,包括 3 次插入0 次删除
  1. 3 0
      project.py

+ 3 - 0
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: