Skip to content

Read config from dash-prefixed default branches - #4277

Merged
max-sixty merged 1 commit into
max-sixty:mainfrom
Duang777:fix/dashed-default-branch-config
Sep 25, 2026
Merged

max-sixty merged 1 commit into
max-sixty:mainfrom
Duang777:fix/dashed-default-branch-config

Conversation

@Duang777

Copy link
Copy Markdown
Contributor

Summary

  • pass --end-of-options to git show before the project-config revision
  • cover bare repositories whose configured default branch starts with -

Problem

When no worktree has the default branch checked out, Worktrunk reads the committed .config/wt.toml with git show <branch>:.config/wt.toml. Git parses a revision such as -x:.config/wt.toml as an option. The best-effort fallback then returns no project config, so hooks, aliases, and other project settings disappear without an error.

Tests

  • Confirmed the new integration test failed before the fix with project.config = null.
  • Confirmed the targeted test and the adjacent object-store fallback test pass after the fix.
  • Ran PATH=/opt/homebrew/bin:$PATH mise exec rust@1.97 -- cargo run -- hook pre-merge --yes: 4,968 tests passed and 1 skipped; fmt, clippy, rustdoc, and doctests passed.

@max-sixty
max-sixty merged commit 51f9a7c into max-sixty:main Sep 25, 2026
38 checks passed
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