Conversation
ruifm
left a comment
There was a problem hiding this comment.
Again, many thanks for this. Maybe this new functionality warrants a new public function / git command as well. Does not need to be in this PR though.
Also, could you preface the commit message with feat: ?
| local branch = get_remote_branch(remote) | ||
| if branch then | ||
| repo.rev = branch | ||
| end | ||
|
|
||
| return repo |
There was a problem hiding this comment.
why call the key rev when it's always a branch name or nil? I would prefer repo.branch
| local branch = get_remote_branch(remote) | ||
| if branch then | ||
| repo.rev = branch | ||
| end |
There was a problem hiding this comment.
No need for conditionality here, always set it, even if nil, it will be checked later anyways 😉
| local branch = get_remote_branch(remote) | |
| if branch then | |
| repo.rev = branch | |
| end | |
| repo.branch = get_remote_branch(remote) |
|
|
||
| return vim.tbl_extend("force", repo_url_data, { | ||
| rev = rev, | ||
| rev = repo_url_data.rev or rev, |
There was a problem hiding this comment.
we wouldn't have to do this if the key was called branch. Then we can embed both the branch name and the rev sha in the url data that is passed to callbacks.
Which is good because then it is up to the callbacks to decide what they want to do (either use the branch name or the rev sha).
fixes #25