wakatime/wakatime-cli

Git worktrees project detection failing

fazibear opened this issue · 2 comments

When using worktrees project is incorrectly detected. Branch name is taken instead of project name.

Environment:

  • OS: mac
  • Platform: arm64

Git setted like this:

git clone --bare https://github.com/wakatime/wakatime-cli wakatime-cli
cd wakatime-cli
git worktree add master
cd master

Also tired https://morgan.cugerone.com/blog/how-to-use-git-worktree-and-in-a-clean-way/ with .bare solution but with no luck.

Looks like it failing on this: https://github.com/wakatime/wakatime-cli/blob/develop/pkg/project/git.go#L247 (there is no dir .git)

I can see it's not correctly getting project name, I'll debug and come back with a solution.

@fazibear released version 1.88.1 to fix it.