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 5929 Build 6212: arc lint + arc unit
Event Timeline
tools/tools/git/importgit | ||
---|---|---|
98 | Lovely, seems like a regression then: $ cd / |
tools/tools/git/importgit | ||
---|---|---|
98 | 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 | 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.