In a git worktree, the gitdir is in an entirely different location.
Use git rev-parse --git-dir to get the correct path to it always.
Details
Details
- Reviewers
markj - Commits
- rS308562: Fix git tools when run against a worktree
Diff Detail
Diff Detail
- Lint
Lint Passed - Unit
No Test Coverage - Build Status
Buildable 5927 Build 6211: arc lint + arc unit
Event Timeline
tools/tools/git/importgit | ||
---|---|---|
98 ↗ | (On Diff #22158) | Lovely, seems like a regression then: $ cd / |
tools/tools/git/importgit | ||
---|---|---|
98 ↗ | (On Diff #22158) | Nope, I see the same behaviour from a native git tree. It's only work trees that give absolute paths. *sigh* |
tools/tools/git/importgit | ||
---|---|---|
98 ↗ | (On Diff #22158) | Compounding my confusion, old-style worktrees created with git-new-workdir also give relative paths. |
Comment Actions
I'd consider setting git="git -C $git_repo" and using $git everywhere instead, but this looks like it works.