Skip to content

Fix/enable worktrees sui precommit#1968

Merged
paulusrex merged 3 commits intomasterfrom
fix/enable-worktress-sui-precommit
Feb 5, 2026
Merged

Fix/enable worktrees sui precommit#1968
paulusrex merged 3 commits intomasterfrom
fix/enable-worktress-sui-precommit

Conversation

@paulusrex
Copy link
Contributor

@paulusrex paulusrex commented Feb 3, 2026

Description

This PR fixes an issue with sui-precommit when working with Git worktrees checking if we are working on a worktree directory and adjust the paths accordingly.

Git worktrees allow developers (and AI agents) to run multiple branches in parallel on the same machine. Since sui-precommit was developed when this feature was less common, the tool previously assumed the working directory was always a standard repository root and not a worktree.

Screenshot 2026-02-03 at 19 13 23

Review steps

git worktree add ../sui-repo.worktrees/hotfix-branch -b hotfix-branch
cd ../sui-repo.worktrees/hotfix-branch
npm install

now
Inside a repo with sui-mono and sui-precommit will fail

after change
The npm install will suceed

Manual checks

I manually did these checks installing my local modified package and create a worktree:

  • Install on worktree works fine
  • Install on main repo works fine
  • sui-mono commit works fine on main and worktree repo.
  • sui-mono commit-all works fine on main and worktree repo.

@jordevo jordevo changed the title Fix/enable worktress sui precommit Fix/enable worktrees sui precommit Feb 5, 2026
@paulusrex paulusrex merged commit a5efd94 into master Feb 5, 2026
2 checks passed
@paulusrex paulusrex deleted the fix/enable-worktress-sui-precommit branch February 5, 2026 08:55
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