Skip to content

Fetch official tap HEAD for worktrees - #23472

Merged
MikeMcQuaid merged 1 commit into
mainfrom
fresh-official-tap
Aug 8, 2026
Merged

Fetch official tap HEAD for worktrees#23472
MikeMcQuaid merged 1 commit into
mainfrom
fresh-official-tap

Conversation

@MikeMcQuaid

Copy link
Copy Markdown
Member
  • Avoid creating official tap worktrees from a stale local branch.
  • Preserve source state and offline fallback to the existing HEAD.

  • Have you followed our Contributing guidelines?
  • Have you checked for other open Pull Requests for the same change?
  • Have you explained what your changes do? Performance claims (e.g. "this is faster") must include Hyperfine benchmarks.
  • Have you explained why you'd like these changes included, not just what they do?
  • For bug fixes, have you given step-by-step brew commands to reproduce the bug?
  • Have you written new tests (excluding integration tests)? Here's an example.
  • Have you successfully run brew lgtm (style, typechecking and tests) locally?

  • I did not use AI/LLM to create this PR, or I disclosed the tool/model below and reviewed its output; I did not attribute commits to AI and will answer maintainer questions and review comments myself without AI/LLM.

OpenAI Codex 5.6 Sol xhigh with local review and testing.


Copilot AI lite review requested due to automatic review settings August 7, 2026 15:34
@MikeMcQuaid
MikeMcQuaid enabled auto-merge August 7, 2026 15:36

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This pull request updates Tap#install to ensure official taps created as worktrees are based on an up-to-date remote commit rather than a potentially stale local branch, while preserving the source checkout’s working state and allowing fallback to the existing HEAD when fetch isn’t possible.

Changes:

  • Fetch origin/HEAD in the source tap checkout and use FETCH_HEAD’s commit when creating the detached worktree.
  • Add an RSpec regression test ensuring the worktree is created from the fetched remote HEAD without modifying the source checkout state.

Reviewed changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.

File Description
Library/Homebrew/tap.rb Fetches remote HEAD for source-tap worktree installs and uses the fetched commit for the worktree target.
Library/Homebrew/test/tap_spec.rb Adds a test covering worktree creation from fetched remote HEAD while preserving source checkout state.

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

Comment thread Library/Homebrew/tap.rb
- Avoid creating official tap worktrees from a stale local branch.
- Preserve source state and offline fallback to the existing `HEAD`.
@MikeMcQuaid
MikeMcQuaid added this pull request to the merge queue Aug 8, 2026
Merged via the queue into main with commit fe24bd2 Aug 8, 2026
44 of 47 checks passed
@MikeMcQuaid
MikeMcQuaid deleted the fresh-official-tap branch August 8, 2026 04:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants