fix: build.rs rerun-if-changed watches wrong paths in worktrees#303
Merged
fix: build.rs rerun-if-changed watches wrong paths in worktrees#303
Conversation
In git worktrees, `git rev-parse --git-dir` returns a worktree-specific path (e.g., `.git/worktrees/<name>/`) but loose refs and tags live in the common git dir (`.git/`). The build script was watching ref paths under the worktree git-dir where the files don't exist, so it never re-ran when new commits were made or tags changed. This caused `daft_dev_build` cfg to become stale: if the initial build happened on a tagged release commit, subsequent builds on untagged branch commits would still think they were release builds, breaking DAFT_CONFIG_DIR override and its tests. Fix: use `--git-common-dir` for loose ref and packed-refs paths. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This was referenced Mar 15, 2026
Merged
Merged
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
git rev-parse --git-dirreturns a worktree-specific path (.git/worktrees/<name>/) but loose refs and tags live in the common git dir (.git/). The build script watched ref paths under the worktree git-dir where the files don't exist, so it never re-ran when new commits were made.daft_dev_buildcfg to become stale: if the initial build happened on a tagged release commit (e.g.,v1.1.0), subsequent builds on untagged branch commits still thought they were release builds, breakingDAFT_CONFIG_DIRoverride and its unit tests.--git-common-dirfor loose ref andpacked-refspaths.Test plan
cargo clean -p daft && cargo test --libpasses all 636 testscargo clean), build script re-runs anddaft_dev_buildis correctly set🤖 Generated with Claude Code