git-worktree.nvim icon indicating copy to clipboard operation
git-worktree.nvim copied to clipboard

Additional origin added for Head and Merge

Open skipadu opened this issue 3 years ago • 2 comments
trafficstars

I have occassionally problem when I'm creating new worktree, using the telescope extension to do that. I try to describe the issue and if someone have knowledge what I'm doing wrong and could tell me how to fix it.

Working one

When it successfully creates new worktree I can see that following infos are correct when looked with vim-fugitive:

Head: fix/jumping-frog
Merge: origin/fix/jumping-frog

And this works as wanted; able to see correct history of Git, git log and so on.

Broken one

When it is broken one, it does not say any error or so but the infos are somehow messed as it puts additional origin as following:

Head: origin/feature/cooling-box
Push: origin/origin/feature/cooling-box

Using Telescope extension

This is how I call the telescope extension:

nnoremap <silent> <Leader>G :lua require('telescope').extensions.git_worktree.create_git_worktree()<CR>

Then I choose wanted branch and press Enter. I will leave the Path to subtree as empty (I have tested to give it a path, but same issue exists.) I wait that it has done it's thing "Running post switch callbacks" etc.

After this I can confirm the issue by looking the git log and it does not show the changes of that branch, but instead the default branch of the repo, develop. And when looking the status with vim-fugitive, the additional origin was added.

skipadu avatar Feb 08 '22 07:02 skipadu

Seeing the same issue, did you happen to find a solution? Always happen when I try to create a branch from a origin branch that I don't have locally

RobertBrunhage avatar Oct 03 '22 04:10 RobertBrunhage

Seeing the same issue, did you happen to find a solution? Always happen when I try to create a branch from a origin branch that I don't have locally

No, I did not find a solution for this.

skipadu avatar Oct 06 '22 07:10 skipadu