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
Get remote branch #39
base: master
Are you sure you want to change the base?
Conversation
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.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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) |
rev = rev, | ||
rev = repo_url_data.rev or rev, |
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.
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