Skip to content

Commit 2b56c7d

Browse files
committed
fix: skip feature-branch validation when feature.json pins FEATURE_DIR
1 parent 5e7723b commit 2b56c7d

2 files changed

Lines changed: 9 additions & 3 deletions

File tree

scripts/bash/setup-tasks.sh

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,10 @@ eval "$_paths_output"
2828
unset _paths_output
2929

3030
# Validate branch
31-
check_feature_branch "$CURRENT_BRANCH" "$HAS_GIT" || exit 1
31+
# If feature.json pins an existing feature directory, branch naming is not required.
32+
if ! feature_json_matches_feature_dir "$REPO_ROOT" "$FEATURE_DIR"; then
33+
check_feature_branch "$CURRENT_BRANCH" "$HAS_GIT" || exit 1
34+
fi
3235

3336
# Validate prerequisites
3437
if [[ ! -d "$FEATURE_DIR" ]]; then

scripts/powershell/setup-tasks.ps1

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,11 @@ if ($Help) {
1919
# Get feature paths and validate branch
2020
$paths = Get-FeaturePathsEnv
2121

22-
if (-not (Test-FeatureBranch -Branch $paths.CURRENT_BRANCH -HasGit:$paths.HAS_GIT)) {
23-
exit 1
22+
# If feature.json pins an existing feature directory, branch naming is not required.
23+
if (-not (Test-FeatureJsonMatchesFeatureDir -RepoRoot $paths.REPO_ROOT -ActiveFeatureDir $paths.FEATURE_DIR)) {
24+
if (-not (Test-FeatureBranch -Branch $paths.CURRENT_BRANCH -HasGit $paths.HAS_GIT)) {
25+
exit 1
26+
}
2427
}
2528

2629
# Validate prerequisites

0 commit comments

Comments
 (0)