Skip to content

Commit

Permalink
Merge pull request #841 from epage/allow
Browse files Browse the repository at this point in the history
fix: Try to improve allow_branch error
  • Loading branch information
epage authored Nov 15, 2024
2 parents 65c787c + 6309d0c commit d27494f
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions src/steps/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -126,12 +126,14 @@ pub fn verify_git_branch(
let good_branches = good_branches.build()?;
let good_branch_match = good_branches.matched_path_or_any_parents(&branch, false);
if !good_branch_match.is_ignore() {
let allowed = ws_config
.allow_branch()
.map(|b| format!("`{b}`"))
.join(", ");
let _ = crate::ops::shell::log(
level,
format!(
"cannot release from branch {:?}, instead switch to {:?}",
branch,
ws_config.allow_branch().join(", ")
"cannot release from branch `{branch}` as it doesn't match {allowed}; either switch to an allowed branch or add this branch to `allow-branch`",
),
);
log::trace!("due to {:?}", good_branch_match);
Expand Down

0 comments on commit d27494f

Please sign in to comment.