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

Support packages that are not at the root of a git repository. #846

Merged
merged 3 commits into from
Jun 19, 2015

Conversation

mbjones
Copy link
Contributor

@mbjones mbjones commented Jun 11, 2015

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.

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)
Copy link
Member

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?

@hadley
Copy link
Member

hadley commented Jun 19, 2015

Thanks - could you please also add a bullet point to NEWS?

@mbjones
Copy link
Contributor Author

mbjones commented Jun 19, 2015

Yes, I'll change to use 'TRUE', and add a bullet to news in a revised PR. More soon...

@mbjones
Copy link
Contributor Author

mbjones commented Jun 19, 2015

@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?

@hadley
Copy link
Member

hadley commented Jun 19, 2015

codecov is mostly informatively - I'm still experimenting with it.

hadley added a commit that referenced this pull request Jun 19, 2015
Support packages that are not at the root of a git repository.
@hadley hadley merged commit f8dd20e into r-lib:master Jun 19, 2015
@hadley
Copy link
Member

hadley commented Jun 19, 2015

Thanks!

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.

2 participants