wakatime / wakatime-cli

Command line interface used by all WakaTime text editor plugins
https://wakatime.com/plugins
BSD 3-Clause "New" or "Revised" License
265 stars 41 forks source link

Git worktrees project detection failing #1001

Closed fazibear closed 6 months ago

fazibear commented 6 months ago

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

Environment:

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)

gandarez commented 6 months ago

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

gandarez commented 6 months ago

@fazibear released version 1.88.1 to fix it.