YahnisElsts / plugin-update-checker

A custom update checker for WordPress plugins. Useful if you don't want to host your project in the official WP repository, but would still like it to support automatic updates. Despite the name, it also works with themes.
MIT License
2.25k stars 410 forks source link

Adds possible default branch name 'main': Bitbucket #433

Closed geoffthibeau closed 3 years ago

geoffthibeau commented 3 years ago

Adds main as a possible default branch name to invoke $this->getLatestTag() inside of Puc_v4p11_Vcs_BitBucketApi::chooseReference().

Previously, only branches named master inherited this special behavior. With more VCS providers opting for an inclusive default branch name, this commit adds main as a default branch name configuration.

Related to #422.

YahnisElsts commented 3 years ago

Thank you for the PR! I should probably rework the default branch detection at some point, but this will help for now.

geoffthibeau commented 3 years ago

A suggestion: provide a setter for what reference is preferred. E.g., $myUpdateChecker->setReference('getLatestTag') or $myUpdateChecker->setReference('getLatestRelease') or $myUpdateChecker->setReference('getBranch').

Basically a hook into Puc_v4p11_Vcs_Api::chooseReference() without relying on a specific branch name.