From 53166c41ce25221cfe64038643ef3441415b3ccc Mon Sep 17 00:00:00 2001 From: Stefan Widgren Date: Wed, 23 Feb 2022 19:47:37 +0100 Subject: [PATCH] vignette: handle when 'defaultBranch' is specified in '.gitconfig' --- vignettes/workflow.Rmd | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/vignettes/workflow.Rmd b/vignettes/workflow.Rmd index b6f0b904..e191bebb 100644 --- a/vignettes/workflow.Rmd +++ b/vignettes/workflow.Rmd @@ -61,7 +61,8 @@ writeLines("*extra*", file.path(path, ".gitignore")) git2r::add(init_repo, ".gitignore", force = TRUE) git2r::commit(init_repo, message = "Initial commit") # push initial commit to remote -git2r::push(init_repo, "origin", "refs/heads/master") +branch_name <- git2r::branches(init_repo)[[1]]$name +git2r::push(init_repo, "origin", paste0("refs/heads/", branch_name)) rm(init_repo) ```