From 0fb65e67c43f8e1e6d7487fc21de5fe46cd1a7e2 Mon Sep 17 00:00:00 2001 From: Seiya Kojima Date: Tue, 17 Mar 2026 18:30:52 +0900 Subject: [PATCH] fix(scripts): suppress stdout from git fetch in create-new-feature.sh 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`). --- scripts/bash/create-new-feature.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/bash/create-new-feature.sh b/scripts/bash/create-new-feature.sh index f7f59884ae..58c5c86c48 100644 --- a/scripts/bash/create-new-feature.sh +++ b/scripts/bash/create-new-feature.sh @@ -138,7 +138,7 @@ check_existing_branches() { local specs_dir="$1" # Fetch all remotes to get latest branch info (suppress errors if no remotes) - git fetch --all --prune 2>/dev/null || true + git fetch --all --prune >/dev/null 2>&1 || true # Get highest number from ALL branches (not just matching short name) local highest_branch=$(get_highest_from_branches)