-
-
Notifications
You must be signed in to change notification settings - Fork 16
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
[RFC] Set --track when creating a worktree #20
Conversation
User should be able to define any upstream string using --set-upstream-to.
@@ -145,6 +153,11 @@ function M.create_worktree_job(path, branch, found_branch) | |||
table.insert(worktree_add_args, branch) | |||
end | |||
|
|||
if found_upstream then |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Actually, it only makes sense to use --track when the branch does not exist and -b is used in git-worktree add.
I have improved it a bit in my main branch, please let me know if you have interest so I can prepare a proper PR. |
I am interested. I am entering a busy period of the year. I will try to find time to look into it soon |
Understood! I will send a proper PR later on then :) |
This PR is not to be merged because it is based off these other two: #18 #19
Basically, instead of using git-branch with --set-upstream-to after creating a worktree, the plugin should simply use git-worktree --track instead. That would simplify things a lot for the case where upstream ~= nil in worktree.lua. I wanted to ask you what do you think the best approach should be here.
Thanks,