1818# '
1919# ' @section CRAN release:
2020# ' If `is_cran` is `TRUE`, the workflow is changed slightly:
21- # ' - push to release branch, not master .
21+ # ' - push to release branch, not main .
2222# ' - doesn't run [release_complete()]. This must be done manually after accepted
2323# ' on CRAN.
2424# ' @keywords internal
@@ -27,7 +27,7 @@ release_gh <- function(bump = "dev", is_cran = bump != "dev") {
2727 new_dsc $ write()
2828 git_branch_set(is_cran )
2929 if (! is_cran ) {
30- on.exit(sys_call(" git" , c(" checkout" , " master " )), add = TRUE )
30+ on.exit(sys_call(" git" , c(" checkout" , " main " )), add = TRUE )
3131 }
3232
3333 # if we fail, must reset version, if we succeed, it's not stage
@@ -78,12 +78,12 @@ release_gh <- function(bump = "dev", is_cran = bump != "dev") {
7878# ' @param tag The tag to push. `NULL` will derive the tag from `DESCRIPTION`.
7979# ' @keywords internal
8080release_complete <- function (ask = TRUE , is_cran = ask , tag = NULL ) {
81- if (git_branch_get() != " master " ) {
82- rlang :: abort(" Must be on master to complete the release." )
81+ if (git_branch_get() != " main " ) {
82+ rlang :: abort(" Must be on main to complete the release." )
8383 }
8484 if (ask ) {
85- abort_if_not_yes(" Did you merge the release branch into master ?" )
86- abort_if_not_yes(" Did you pull the latest master from origin?" )
85+ abort_if_not_yes(" Did you merge the release branch into main ?" )
86+ abort_if_not_yes(" Did you pull the latest main from origin?" )
8787 }
8888 if (is_cran ) {
8989 if (is.null(tag )) {
@@ -94,7 +94,7 @@ release_complete <- function(ask = TRUE, is_cran = ask, tag = NULL) {
9494 }
9595 sys_call(" git" , glue :: glue(" push origin {tag}" ))
9696 }
97- precommit :: autoupdate() # only updates if tag is on the master branch
97+ precommit :: autoupdate() # only updates if tag is on the main branch
9898 desc :: desc_bump_version(" dev" )
9999 cli :: cli_alert_success(" Bumped version to dev" )
100100 sys_call(" git" , glue :: glue(' commit DESCRIPTION .pre-commit-config.yaml -m "use latest release"' ),
@@ -184,9 +184,9 @@ git_branch_set <- function(is_cran) {
184184 )
185185 cli :: cli_alert_success(" Checked out branch {branch_name} for CRAN release process." )
186186 } else {
187- if (git_branch_get() != " master " ) {
187+ if (git_branch_get() != " main " ) {
188188 rlang :: abort(paste(
189- " Need to be on branch 'master ' to create a release, otherwise autoudate" ,
189+ " Need to be on branch 'main ' to create a release, otherwise autoudate" ,
190190 " won't use the new ref."
191191 ))
192192 }
@@ -196,9 +196,9 @@ git_branch_set <- function(is_cran) {
196196
197197git_assert_even_with_origin <- function () {
198198 tmp <- tempfile()
199- system2(" git" , " diff HEAD..origin/master " , stdout = tmp )
199+ system2(" git" , " diff HEAD..origin/main " , stdout = tmp )
200200 if (length(readLines(tmp ) > 0 )) {
201- rlang :: abort(" remote master must be even with local master before release process can start." )
201+ rlang :: abort(" remote main must be even with local main before release process can start." )
202202 }
203203}
204204
0 commit comments