Description
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.