-
Notifications
You must be signed in to change notification settings - Fork 761
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
Support packages that are not at the root of a git repository. #846
Conversation
This fix adds 'discover=T' to git2r:repository() calls in order to allow devtools to locate the repository root directory when the package is in a subdirectory of the overall git repository. This change should address issue r-lib#845.
@@ -3,19 +3,19 @@ uses_git <- function(path = ".") { | |||
} | |||
|
|||
git_sha1 <- function(n = 10, path = ".") { | |||
r <- git2r::repository(path) | |||
r <- git2r::repository(path, discover=T) |
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.
Could you please use discover = TRUE
?
Thanks - could you please also add a bullet point to NEWS? |
Yes, I'll change to use 'TRUE', and add a bullet to news in a revised PR. More soon... |
@hadley I made the changes you requested, and tests passed on my local Mac deployment, as well as in Travis. I'm not clear on your development workflow -- do you want PRs to fix the codecov issues? Or does this look good now? |
codecov is mostly informatively - I'm still experimenting with it. |
Support packages that are not at the root of a git repository.
Thanks! |
This fix adds 'discover=T' to git2r:repository() calls in order to allow devtools to locate the repository root directory when the package is in a subdirectory of the overall git repository. This change should address issue #845. I have tested this on Mac OS X under R 3.2.0.
I encountered this problem when trying to release() a package that was not at the root of its git repository, and the git_uncommitted() function threw an error as described in #845. After the fix, git_uncommitted() correctly detects the repository root.