Skip to content

fix: move branch validation after --paths-only exit#2481

Open
mnriem wants to merge 1 commit into
github:mainfrom
mnriem:fix/paths-only-skip-branch-validation
Open

fix: move branch validation after --paths-only exit#2481
mnriem wants to merge 1 commit into
github:mainfrom
mnriem:fix/paths-only-skip-branch-validation

Conversation

@mnriem
Copy link
Copy Markdown
Collaborator

@mnriem mnriem commented May 7, 2026

check-prerequisites.sh and check-prerequisites.ps1 ran branch validation before the --paths-only early exit, causing --paths-only to fail on non-feature branches despite documentation stating 'no validation'.

Move check_feature_branch / Test-FeatureBranch after the paths-only block so callers that only need path variables are not subject to branch-name checks.

Fixes #2477

check-prerequisites.sh and check-prerequisites.ps1 ran branch validation
before the --paths-only early exit, causing --paths-only to fail on
non-feature branches despite documentation stating 'no validation'.

Move check_feature_branch / Test-FeatureBranch after the paths-only block
so callers that only need path variables are not subject to branch-name
checks.

Fixes github#2477
Copilot AI review requested due to automatic review settings May 7, 2026 17:06
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes an inconsistency between documentation and behavior in the consolidated prerequisite scripts: --paths-only / -PathsOnly is documented as “no validation”, but branch-name validation was still being executed before the early exit, causing unexpected failures on non-feature branches.

Changes:

  • Move branch-name validation to occur after the --paths-only / -PathsOnly early-exit block in the Bash script.
  • Apply the same ordering change in the PowerShell script to keep behavior consistent across shells.
Show a summary per file
File Description
scripts/bash/check-prerequisites.sh Moves check_feature_branch after the --paths-only early exit so paths-only mode truly skips branch validation.
scripts/powershell/check-prerequisites.ps1 Moves Test-FeatureBranch after the -PathsOnly early exit for parity with the Bash script.

Copilot's findings

Tip

Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

  • Files reviewed: 2/2 changed files
  • Comments generated: 1

Comment on lines +114 to +116
# Validate branch name
check_feature_branch "$CURRENT_BRANCH" "$HAS_GIT" || exit 1

@mnriem
Copy link
Copy Markdown
Collaborator Author

mnriem commented May 7, 2026

@copilot apply changes based on the comments in this thread

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

[Bug]: check-prerequisites.sh --paths-only still runs branch validation, contradicting --help

2 participants