Skip to content

Commit 7a5762f

Browse files
authored
fix(scripts): suppress stdout from git fetch in create-new-feature.sh (#1876)
In multi-remote environments, `git fetch --all` outputs messages like "Fetching origin" to stdout. Since `check_existing_branches()` only redirected stderr (`2>/dev/null`), the stdout output was captured by the `$(...)` command substitution calling this function, contaminating the branch number return value and causing arithmetic errors like `$((10#Fetching...))`. Fix: redirect both stdout and stderr to /dev/null (`>/dev/null 2>&1`).
1 parent 9c0c144 commit 7a5762f

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

scripts/bash/create-new-feature.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ check_existing_branches() {
138138
local specs_dir="$1"
139139

140140
# Fetch all remotes to get latest branch info (suppress errors if no remotes)
141-
git fetch --all --prune 2>/dev/null || true
141+
git fetch --all --prune >/dev/null 2>&1 || true
142142

143143
# Get highest number from ALL branches (not just matching short name)
144144
local highest_branch=$(get_highest_from_branches)

0 commit comments

Comments
 (0)