You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.
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.
The text was updated successfully, but these errors were encountered:
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.
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/
lockbot
locked and limited conversation to collaborators
Sep 18, 2018
Sign up for freeto subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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 ingit_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 tor <- git2r::repository(path)
returns an error that the directory is not a valid 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 likegit_uncommitted()
, like this:Does this seem reasonable? I will add a pull request shortly.
The text was updated successfully, but these errors were encountered: