Skip to content

Commit

Permalink
fix: make it work for other default branch name
Browse files Browse the repository at this point in the history
  • Loading branch information
maelle committed Jan 11, 2024
1 parent cb46c0b commit 68c1bcf
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion R/committed-to-wrong-branch.R
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,12 @@ exo_committed_to_wrong <- function(parent_path) {
git_commit("First commit")

gert::git_branch_create("feat-bla")
gert::git_branch_checkout("main")

if ("main" %in% gert::git_branch_list()[["name"]]) {
gert::git_branch_checkout("main")
} else {
gert::git_branch_checkout("master")
}

gert::git_branch_create("hot-fix")
brio::write_lines("lala", "fix.txt")
Expand Down

0 comments on commit 68c1bcf

Please sign in to comment.