download_strategy: fix UID handling with credential helpers on fetch

This commit is contained in:
Bo Anderson 2025-08-15 20:22:30 +01:00
parent c493fc6944
commit 2dc77a4485
No known key found for this signature in database

View File

@ -1106,20 +1106,25 @@ class GitDownloadStrategy < VCSDownloadStrategy
# Convert any shallow clone to full clone
if shallow_dir?
command! "git",
args: ["fetch", "origin", "--unshallow"],
chdir: cached_location,
timeout: Utils::Timer.remaining(timeout)
args: ["fetch", "origin", "--unshallow"],
chdir: cached_location,
timeout: Utils::Timer.remaining(timeout),
reset_uid: true
else
command! "git",
args: ["fetch", "origin"],
chdir: cached_location,
timeout: Utils::Timer.remaining(timeout)
args: ["fetch", "origin"],
chdir: cached_location,
timeout: Utils::Timer.remaining(timeout),
reset_uid: true
end
end
sig { override.params(timeout: T.nilable(Time)).void }
def clone_repo(timeout: nil)
command! "git", args: clone_args, timeout: Utils::Timer.remaining(timeout)
command! "git",
args: clone_args,
timeout: Utils::Timer.remaining(timeout),
reset_uid: true
command! "git",
args: ["config", "homebrew.cacheversion", cache_version],