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() assumes package root is git repository root #845

Closed
mbjones opened this issue Jun 11, 2015 · 1 comment
Closed

release() assumes package root is git repository root #845

mbjones opened this issue Jun 11, 2015 · 1 comment

Comments

@mbjones
Copy link
Contributor

mbjones commented Jun 11, 2015

Current checks using git2r ensure that a package that is in a git repository doesn't have uncommitted changes and that the checkout is clean. However, the checks in git.R in git_uncommited() and similar functions assume that the package is rooted in the top-level repository directory. For packages that are in a subdirectory contained within a larger git repository, the call to r <- git2r::repository(path) returns an error that the directory is not a valid repository:

Error in validObject(.Object) : 
  invalid class “git_repository” object: Invalid repository

It seems to me that devtools should not require that the package root directory be the same as the git repository root directory. This is easily fixed by adding discover=T to the repository check in functions like git_uncommitted(), like this:

 r <- git2r::repository(path, discover=T)

Does this seem reasonable? I will add a pull request shortly.

mbjones added a commit to mbjones/devtools that referenced this issue 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 r-lib#845.
@hadley hadley closed this as completed Jun 23, 2015
@lock
Copy link

lock bot commented Sep 18, 2018

This old issue has been automatically locked. If you believe you have found a related problem, please file a new issue (with reprex) and link to this issue. https://reprex.tidyverse.org/

@lock lock bot locked and limited conversation to collaborators Sep 18, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants