Quellcode durchsuchen

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 vor 10 Jahren
Ursprung
Commit
c4b301f988
1 geänderte Dateien mit 3 neuen und 0 gelöschten Zeilen
  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: