Skip to content
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

release() with detached Git head doesn't throw error #1136

Merged
merged 2 commits into from
Mar 28, 2016
Merged

release() with detached Git head doesn't throw error #1136

merged 2 commits into from
Mar 28, 2016

Conversation

krlmlr
Copy link
Member

@krlmlr krlmlr commented Mar 27, 2016

@stewid: Can this be done better? I have found is_commit(), but not is_branch().

@stewid
Copy link

stewid commented Mar 27, 2016

@krlmlr Looks fine 👍 . I have added the is_branch method to git2r ropensci/git2r@a5e65c3

I suggest that you add n = 1 in c1 <- git2r::commits(r, n = 1)[[1]]
https://github.com/krlmlr/devtools/blob/feature/git-detached/R/git.R#L32 to avoid listing all commits

@krlmlr
Copy link
Member Author

krlmlr commented Mar 28, 2016

Thanks. The code is now using branch_target(), looks like this is the most accurate solution (equivalent to commits(r, n = 1, time = FALSE, topological = FALSE)).

@hadley hadley merged commit bd52c94 into r-lib:master Mar 28, 2016
@hadley
Copy link
Member

hadley commented Mar 28, 2016

Thanks! Do you have any thoughts on #1128?

@krlmlr krlmlr deleted the feature/git-detached branch March 28, 2016 20:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants