GuangchuangYu/badger

Add support for default git branch names other than "master"

rossellhayes opened this issue · 1 comments

Currently, several badger functions are built with the assumption that the default git branch name is "master (badge_last_commit(), badge_travis(), badge_coveralls(), and badge_codecov()).

Recent updates to git allow users to choose a different default branch name for their projects, and a number of R packages have made adjustments to accommodate this. Of particular interest, the 2.0.0 release of usethis will export a function to detect a user's default git branch (git_branch_default()).

Would you be interested in a PR to add support for other default branch names? I could implement this in two ways:

  • A new argument in these functions that would allow users to manually specify a default branch name
  • Automatic default branch detection, which would require less user intervention but add a dependency on usethis

Both solutions could retain "master" as a default in order to avoid breaking changes.

Solved by #22 and #23