Repository navigation
Conversation
…gitmodules` `AutoUpdateSubmodulesAsync` runs after checkout, create branch, merge, pull and reset, and always spawned `git submodule status`. That command is a shell script on Windows and can take seconds (or much longer under endpoint-security process monitoring) even for repositories without submodules. Reuse the existing `MayHaveSubmodules()` check that `RefreshSubmodules` already uses. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
.gitmodules
rsheptolut
marked this pull request as ready for review
December 2, 2026 10:17
This file contains hidden or 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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Problem
Repository.AutoUpdateSubmodulesAsyncruns after checkout, checkout & fast-forward, detached checkout, create branch (with checkout), merge, pull and reset. It always runsgit submodule statusthroughQueryUpdatableSubmodules, even when the repository has no submodules.On Windows,
git submoduleis a shell script (git-submodule.shviash.exe), and it starts many short-lived processes. It's a little slow on any machine, and much slower when endpoint-security software (BeyondTrust EAP - installed on work laptops in some companies) adds a non-negotiable ~500ms delay to every process it starts.Trace of one branch switch in a repo without submodules (
GIT_TRACE2_PERF):git checkout --progress qagit submodule status#894 reported the same
git submodule statuscost on open/refresh. Refresh was later guarded withMayHaveSubmodules()in 1ee7d11 (#1344), but the auto-update path after checkout/merge/pull/reset never got that guard.Change
Return early from
AutoUpdateSubmodulesAsyncwhenMayHaveSubmodules()is false, the same checkRefreshSubmodules()andWatcheralready use. Repositories with a.gitmodulesfile behave exactly as before.Testing
git submodule status. The branch switch dropped from ~51 s to under 1 s in the environment above.MayHaveSubmodules()returns true and the existing flow runs.