Merge pull request #20476 from Homebrew/git-credential-uid

download_strategy: fix UID handling with credential helpers on fetch
This commit is contained in:
Mike McQuaid 2025-08-15 19:39:00 +00:00 committed by GitHub
commit 4910ac215e
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194

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],