From 34e4ec2460d960b5fcab791e76f3b2b8e737e42d Mon Sep 17 00:00:00 2001 From: Bo Anderson Date: Sun, 5 Nov 2023 00:44:50 +0000 Subject: [PATCH] tap: fix repair not working in some cases --- Library/Homebrew/tap.rb | 2 ++ 1 file changed, 2 insertions(+) diff --git a/Library/Homebrew/tap.rb b/Library/Homebrew/tap.rb index 277ad75a01..96ab6bf340 100644 --- a/Library/Homebrew/tap.rb +++ b/Library/Homebrew/tap.rb @@ -427,12 +427,14 @@ class Tap args = %w[fetch] args << "--quiet" if quiet args << "origin" + args << "+refs/heads/*:refs/remotes/origin/*" safe_system "git", "-C", path, *args git_repo.set_head_origin_auto new_upstream_head = T.must(git_repo.origin_branch_name) return if new_upstream_head == current_upstream_head + safe_system "git", "-C", path, "config", "remote.origin.fetch", "+refs/heads/*:refs/remotes/origin/*" git_repo.rename_branch old: current_upstream_head, new: new_upstream_head git_repo.set_upstream_branch local: new_upstream_head, origin: new_upstream_head