Skip to content

Commit 4da0da6

Browse files
committed
fix: address PR review feedback
- Set GIT_TERMINAL_PROMPT=0 for git ls-remote calls to prevent credential prompts from blocking dry-run in automation scenarios - Add returncode assertion to test_dry_run_with_timestamp git branch --list check Assisted-By: 🤖 Claude Code
1 parent 594f632 commit 4da0da6

File tree

3 files changed

+4
-1
lines changed

3 files changed

+4
-1
lines changed

scripts/bash/create-new-feature.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ get_highest_from_remote_refs() {
141141

142142
for remote in $(git remote 2>/dev/null); do
143143
local remote_highest
144-
remote_highest=$(git ls-remote --heads "$remote" 2>/dev/null | sed 's|.*refs/heads/||' | _extract_highest_number)
144+
remote_highest=$(GIT_TERMINAL_PROMPT=0 git ls-remote --heads "$remote" 2>/dev/null | sed 's|.*refs/heads/||' | _extract_highest_number)
145145
if [ "$remote_highest" -gt "$highest" ]; then
146146
highest=$remote_highest
147147
fi

scripts/powershell/create-new-feature.ps1

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,9 @@ function Get-HighestNumberFromRemoteRefs {
107107
$remotes = git remote 2>$null
108108
if ($remotes) {
109109
foreach ($remote in $remotes) {
110+
$env:GIT_TERMINAL_PROMPT = '0'
110111
$refs = git ls-remote --heads $remote 2>$null
112+
$env:GIT_TERMINAL_PROMPT = $null
111113
if ($LASTEXITCODE -eq 0 -and $refs) {
112114
$refNames = $refs | ForEach-Object {
113115
if ($_ -match 'refs/heads/(.+)$') { $matches[1] }

tests/test_timestamp_branches.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -606,6 +606,7 @@ def test_dry_run_with_timestamp(self, git_repo: Path):
606606
capture_output=True,
607607
text=True,
608608
)
609+
assert branches.returncode == 0, f"'git branch --list' failed: {branches.stderr}"
609610
assert branches.stdout.strip() == ""
610611

611612
def test_dry_run_with_number(self, git_repo: Path):

0 commit comments

Comments
 (0)