mixu / gr

Multiple git repository management tool
http://mixu.net/gr/
674 stars 104 forks source link

Doesn't work with "git worktree" creating working trees #75

Open tpunder opened 7 years ago

tpunder commented 7 years ago

I noticed that gr doesn't work with a git worktree created working tree. I get an error saying Missing .git directory. The error is accurate since there is no .git directory. Instead git worktree creates a .git file with contents that looks like

gitdir: /path/to/myproject/.git/worktrees/myproject-somebranch

It would be cool if gr played nicely with git worktree!

Information about git worktree here: https://git-scm.com/docs/git-worktree

tpunder commented 7 years ago

The error I'm seeing comes from here: https://github.com/mixu/gr/blob/51b00b0e551806abf0982310644a700732b4a8c6/plugins/status.js#L33

Looks like the logic of this function needs to be changed: https://github.com/mixu/gr/blob/51b00b0e551806abf0982310644a700732b4a8c6/lib/command-requirements.js#L5