hakoerber / git-repo-manager

A git tool to manage worktrees and integrate with GitHub and GitLab
https://hakoerber.github.io/git-repo-manager/
GNU General Public License v3.0
67 stars 9 forks source link

Handle worktrees in subdirectories properly #31

Closed hakoerber closed 2 years ago

hakoerber commented 2 years ago

Currently, the following behaviour is quite weird:

$ grm wt add x/branch

This creates a branch called branch (unexpected) inside the directory x/branch (expected). It's also weird, because the following will fail:

$ grm wt add x/branch
$ grm wt delete x/branch
[✘] Branch "branch" is checked out in worktree, this does not look correct

The docs say:

The branch inside the worktree is always the same as the directory name of the worktree.

So the branch name should be x/branch as well. Note that the worktree cannot contain slashes, so this may be a bit ugly to set up.

hakoerber commented 2 years ago

Fixed with worktree rework