[scm] Run remote set-head if symbolic-ref fails
If symbolic-ref remote HEAD is not available, we skip setting it and query remote Git using ls-remote. Such information is not stored, and gclient will need to repeat it on the next invocation. Instead, we can call set-head on symbolic-ref failure. While that's slower operation than ls-remote, it saved in internal Git database and can be reused on next gclient invocation. We may be okay with hardcoding 'main' as default remote branch today, but it's possible that some projects still use old default. R=gavinmak@google.com Change-Id: Ic4c826b888d96e367039bfc4b9bd2ba0d8b58b52 Reviewed-on: https://chromium-review.googlesource.com/c/chromium/tools/depot_tools/+/5492789 Commit-Queue: Josip Sokcevic <sokcevic@chromium.org> Reviewed-by: Gavin Mak <gavinmak@google.com>changes/89/5492789/2
parent
4246ba023a
commit
8281847e05
Loading…
Reference in New Issue