Skip to content

feat: open repository with worktree support - #287

Merged
talos-bot merged 1 commit into
siderolabs:mainfrom
chrischdi:pr-worktree-support
Jun 26, 2026
Merged

feat: open repository with worktree support#287
talos-bot merged 1 commit into
siderolabs:mainfrom
chrischdi:pr-worktree-support

Conversation

@chrischdi

Copy link
Copy Markdown
Contributor

When being in a git worktree (e.g. via git worktree ../foo) and running conform enforce it fails for me with the following error:

2026/06/03 09:34:34 failed to get commit message: reference not found

The change makes use of the following options for git.PlainOpenWithOptions:

  • DetectDotGit: replacement for findDotGit
  • EnableDotGitCommonDir: to support the .git dirfile

@github-project-automation github-project-automation Bot moved this to To Do in Planning Jun 3, 2026
@talos-bot talos-bot moved this from To Do to In Review in Planning Jun 3, 2026
@chrischdi
chrischdi force-pushed the pr-worktree-support branch from 52b41c0 to 6ec6d0e Compare June 3, 2026 07:38
@smira smira removed this from Planning Jun 3, 2026
Use go-git PlainOpenWithOptions with DetectDotGit and
EnableDotGitCommonDir via a shared OpenRepository helper, so conform
works when invoked from a linked worktree whose .git entry is a gitdir
file. Use this helper in both NewGit and main branch detection, and add
tests covering the worktree case.

Signed-off-by: Christian Schlotter <cschlotter@nvidia.com>
Signed-off-by: Noel Georgi <git@frezbo.dev>
@frezbo
frezbo force-pushed the pr-worktree-support branch from 6ec6d0e to b951e44 Compare June 26, 2026 14:38
@frezbo

frezbo commented Jun 26, 2026

Copy link
Copy Markdown
Member

/m

@talos-bot
talos-bot merged commit b951e44 into siderolabs:main Jun 26, 2026
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants