Compare commits
1 commit
2db32b20dd
...
d6709cc2cb
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
d6709cc2cb |
1 changed files with 3 additions and 8 deletions
|
|
@ -264,16 +264,11 @@ export FORGE_REMOTE
|
||||||
log "forge remote: ${FORGE_REMOTE}"
|
log "forge remote: ${FORGE_REMOTE}"
|
||||||
|
|
||||||
# Generate unique branch name per attempt to avoid collision with failed attempts
|
# Generate unique branch name per attempt to avoid collision with failed attempts
|
||||||
# Only apply when not in recovery mode (RECOVERY_MODE branch is already set from existing PR)
|
|
||||||
# First attempt: fix/issue-N, subsequent: fix/issue-N-1, fix/issue-N-2, etc.
|
# First attempt: fix/issue-N, subsequent: fix/issue-N-1, fix/issue-N-2, etc.
|
||||||
if [ "$RECOVERY_MODE" = false ]; then
|
ATTEMPT=$(git ls-remote --heads "$FORGE_REMOTE" "fix/issue-${ISSUE}*" 2>/dev/null | wc -l)
|
||||||
# Count only branches matching fix/issue-N, fix/issue-N-1, fix/issue-N-2, etc. (exact prefix match)
|
|
||||||
ATTEMPT=$(git ls-remote --heads "$FORGE_REMOTE" "refs/heads/fix/issue-${ISSUE}" 2>/dev/null | grep -c "refs/heads/fix/issue-${ISSUE}$" || echo 0)
|
|
||||||
ATTEMPT=$((ATTEMPT + $(git ls-remote --heads "$FORGE_REMOTE" "refs/heads/fix/issue-${ISSUE}-*" 2>/dev/null | wc -l)))
|
|
||||||
if [ "$ATTEMPT" -gt 0 ]; then
|
if [ "$ATTEMPT" -gt 0 ]; then
|
||||||
BRANCH="fix/issue-${ISSUE}-${ATTEMPT}"
|
BRANCH="fix/issue-${ISSUE}-${ATTEMPT}"
|
||||||
fi
|
fi
|
||||||
fi
|
|
||||||
log "using branch: ${BRANCH}"
|
log "using branch: ${BRANCH}"
|
||||||
|
|
||||||
if [ "$RECOVERY_MODE" = true ]; then
|
if [ "$RECOVERY_MODE" = true ]; then
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue