From 2dc77a448500a017a28c3497e04aae5208cb1df6 Mon Sep 17 00:00:00 2001 From: Bo Anderson Date: Fri, 15 Aug 2025 20:22:30 +0100 Subject: [PATCH] download_strategy: fix UID handling with credential helpers on fetch --- Library/Homebrew/download_strategy.rb | 19 ++++++++++++------- 1 file changed, 12 insertions(+), 7 deletions(-) diff --git a/Library/Homebrew/download_strategy.rb b/Library/Homebrew/download_strategy.rb index 12b1ff7e4f..61a1b9ce38 100644 --- a/Library/Homebrew/download_strategy.rb +++ b/Library/Homebrew/download_strategy.rb @@ -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],