Skip to content

Commit ebdf040

Browse files
SpecificityD3luxeLUCI
authored andcommitted
Add REPO_SKIP_SELF_UPDATE check in sync
The command _PostRepoFetch will try to self update during repo sync. That is beneficial but adds version uncertainty, fail potential and slow downs in non-interactive scenarios. Conditionally skip the update if env variable REPO_SKIP_SELF_UPDATE is defined. A call to selfupdate works as before, meaning even with the variable set, it will run the update. Change-Id: Iab0ef55dc3d3db3cbf1ba1f506c57fbb58a504c3 Reviewed-on: https://gerrit-review.googlesource.com/c/git-repo/+/439967 Tested-by: Fredrik de Groot <[email protected]> Commit-Queue: Josip Sokcevic <[email protected]> Reviewed-by: Josip Sokcevic <[email protected]>
1 parent 303bd96 commit ebdf040

File tree

2 files changed

+6
-1
lines changed

2 files changed

+6
-1
lines changed

docs/release-process.md

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -96,6 +96,9 @@ If that tag is valid, then repo will warn and use that commit instead.
9696

9797
If that tag cannot be verified, it gives up and forces the user to resolve.
9898

99+
If env variable `REPO_SKIP_SELF_UPDATE` is defined, this will
100+
bypass the self update algorithm.
101+
99102
### Force an update
100103

101104
The `repo selfupdate` command can be used to force an immediate update.

subcmds/sync.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -958,7 +958,9 @@ def _FetchMain(
958958
if not success:
959959
err_event.set()
960960

961-
_PostRepoFetch(rp, opt.repo_verify)
961+
# Call self update, unless requested not to
962+
if os.environ.get("REPO_SKIP_SELF_UPDATE", "0") == "0":
963+
_PostRepoFetch(rp, opt.repo_verify)
962964
if opt.network_only:
963965
# Bail out now; the rest touches the working tree.
964966
if err_event.is_set():

0 commit comments

Comments
 (0)