-
Notifications
You must be signed in to change notification settings - Fork 2.6k
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
git v2 client for inrepoconfig: allow targeted fetches (2nd attempt)
This is a reintroduction of bc68007 (git v2 client for inrepoconfig: allow targeted fetches, 2023-08-21), which was reverted in fb82b69 (Revert "Merge pull request #30453 from listx/minimal-fetch", 2023-08-22). This version includes a fix for the timing of the fetch. In bc68007 we called ensureCommits() with "repoClient", but _before_ it was cloned (created)! This version fixes that (now obvious) bug. Below is the original commit message of bc68007, because the semantics there still apply as is. Allow fetching a small number of commit SHAs directly if RepoOpts specifies FetchCommits. This avoids the costly RemoteUpdate call which fetches every remote tracking branch (as well as all new ones that show up on the remote). Make tag fetching optional because they could be unnecessary (for inrepoconfig, we already check out a working tree based on the baseSHA and headSHAs in prowYAMLGetter). Also, only perform a fetch once. Previously in ensureCommits we did at least 2 separate fetch operations for every presubmit job, because a presubmit has a baseSHA and a headSHA (PR HEAD). Now we combine them into a single fetch command, so that we talk to the server once instead of twice.
- Loading branch information
Linus Arver
committed
Aug 23, 2023
1 parent
6406e6d
commit bdd601c
Showing
2 changed files
with
65 additions
and
27 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters