Handle KeyboardInterrupt during repo sync

If interrupt signal is sent to repo process while sync is running, repo
prints stack trace for each concurrent job that is currently running
with no useful information.

Instead, this change captures KeyboardInterrupt in each process and
prints one line about current project that is being processed.

Change-Id: Ieca760ed862341939396b8186ae04128d769cd56
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/357135
Reviewed-by: Joanna Wang <jojwang@google.com>
Tested-by: Josip Sokcevic <sokcevic@google.com>
diff --git a/subcmds/sync.py b/subcmds/sync.py
index 4b7e81d..b80d97b 100644
--- a/subcmds/sync.py
+++ b/subcmds/sync.py
@@ -498,6 +498,8 @@
         print('error: Cannot fetch %s from %s'
               % (project.name, project.remote.url),
               file=sys.stderr)
+    except KeyboardInterrupt as e:
+      print(f'Keyboard interrupt while processing {project.name}')
     except GitError as e:
       print('error.GitError: Cannot fetch %s' % str(e), file=sys.stderr)
     except Exception as e: