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

Projects
None yet
2 participants
@mbjones
Contributor

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.

Support packages that are not at the root of a git repository.
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.
R/git.R Outdated
@@ -3,19 +3,19 @@ uses_git <- function(path = ".") {
}
git_sha1 <- function(n = 10, path = ".") {
r <- git2r::repository(path)
r <- git2r::repository(path, discover=T)

This comment has been minimized.

@hadley

hadley Jun 19, 2015

Member

Could you please use discover = TRUE?

@hadley

This comment has been minimized.

Member

hadley commented Jun 19, 2015

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

@mbjones

This comment has been minimized.

Contributor

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

This comment has been minimized.

Contributor

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

This comment has been minimized.

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

Merge pull request #846 from mbjones/master
Support packages that are not at the root of a git repository.

@hadley hadley merged commit f8dd20e into r-lib:master Jun 19, 2015

2 of 3 checks passed

codecov/patch 0.00% (min required 90%)
Details
codecov/commit 36.90% (min required 0%)
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@hadley

This comment has been minimized.

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