-
Notifications
You must be signed in to change notification settings - Fork 303
Description
TLDR:Use_git doesn't make the initial commit if the project is started already with git from Rstudio
I started a new package following the Rstudio new project > R package > git then I used some of the usethis functions to set up the package.
The history of command run is:
use_rstudio()
use_git()
use_mit_license()
use_testthat()
use_package("package")
desc::desc_normalize()
use_readme_rmd()
use_travis() # Error shown below
use_github()
use_coverage()
use_vignette("name")
?use_github
git_sitrep() # Sitrep shown belowHowever it failed:

Despite having correctly setup the git configuration, see the git_sitrep:

The problem comes from use_github, which expects to find a branch. But the branch is not created in use_git because Rstudio already created the repository and then use_git doesn't continue and commit the "Initial commit".
A solution would be to check if there is any committed file by checking the repository head. This involves the line
Line 14 in 9ffc27f
| if (uses_git()) { |
Which could be adapted to check if there is any committed file or any branch.