SIGN IN SIGN UP
Homebrew / brew UNCLAIMED

🍺 The missing package manager for macOS (or Linux)

0 0 185 Ruby

livecheck: use default branch for git log command

The `git log` command used in the livecheck
`formula_or_cask_last_commit_timestamp` method is implicitly run on
the current branch, which causes unintended behavior when `brew audit`
is run on a cask. `audit_livecheck_version` in `cask/audit.rb`
accounts for a throttle rate and we're updating it to also account for
throttle days but the livecheck logic for identifying the newest
related commit timestamp will be run on a PR branch and the PR commit
is unfortunately viewed as the newest commit. The throttle interval
will not have elapsed in that context and this is an issue for version
bump PRs that are created after the throttle interval elapses, as the
audit will reliably fail and prevent the PR from being merged.

This modifies the commit-finding logic to run the `git log` command on
the repository's default branch (i.e., the remote origin/HEAD branch).
This is `main` in homebrew/core and homebrew/cask but I figured it may
be better not to hardcode this, as third-party taps could use
`throttle`
S
Sam Ford committed
228d99e4d8475d3260d6301a78e4e18910b5fbfc
Parent: 9866e7c