Skip to content

Commit

Permalink
Merge pull request #16180 from Bo98/tap-repair-fix
Browse files Browse the repository at this point in the history
tap: fix repair not working in some cases
  • Loading branch information
Bo98 authored Nov 5, 2023
2 parents 930f24b + 34e4ec2 commit 2fd99da
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions Library/Homebrew/tap.rb
Original file line number Diff line number Diff line change
Expand Up @@ -427,12 +427,14 @@ def fix_remote_configuration(requested_remote: nil, quiet: false)
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

Expand Down

0 comments on commit 2fd99da

Please sign in to comment.