diff options
author | Mike Frysinger <vapier@google.com> | 2021-05-04 17:58:26 -0400 |
---|---|---|
committer | Mike Frysinger <vapier@google.com> | 2021-05-04 23:49:29 +0000 |
commit | 5ba80d404cd6d5dc6d1ccfcfc5f8fc560d82be06 (patch) | |
tree | 72180bb96766ac5546fdcaaad41351d9fa0cb0bc /main.py | |
parent | 1c3f57e8f13d4f6dc818bdf06c3a40f768ef1ce5 (diff) | |
download | git-repo-5ba80d404cd6d5dc6d1ccfcfc5f8fc560d82be06.tar.gz |
git_config: hoist Windows ssh check earlier
The ssh master logic has never worked under Windows which is why this
code always returned False when running there (including cygwin). But
the OS check was still done while holding the threading lock. While
it might be a little slower than necessary, it still worked.
The switch from the threading module to the multiprocessing module
changed global behavior subtly under Windows and broke things: the
globals previously would stay valid, but now they get cleared. So
the lock is reset to None in children workers.
We could tweak the logic to pass the lock through, but there isn't
much point when the rest of the code is still disabled in Windows.
So perform the platform check before we grab the lock. This fixes
the crash, and probably speeds things up a few nanoseconds.
This shouldn't be a problem on Linux systems as the platform fork
will duplicate the existing process memory (including globals).
Bug: https://crbug.com/gerrit/14480
Change-Id: I1d1da82c6d7bd6b8cdc1f03f640a520ecd047063
Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/305149
Reviewed-by: Raman Tenneti <rtenneti@google.com>
Tested-by: Mike Frysinger <vapier@google.com>
Diffstat (limited to 'main.py')
0 files changed, 0 insertions, 0 deletions