Skip to content

Commit 1663988

Browse files
Phlogistiqueclaude
andcommitted
Apply suggestion from @Phlogistique
Lift the first conflict block's fetch/switch/pull out of the loop and open the next block at each iteration's tail, dropping the per-iteration `if [[ "$i" -eq 0 ]]` conditional. Rendered comment is unchanged. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
1 parent b0d9337 commit 1663988

1 file changed

Lines changed: 6 additions & 7 deletions

File tree

update-pr-stack.sh

Lines changed: 6 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -111,20 +111,19 @@ update_direct_target() {
111111
echo " into this branch while updating the pull request stack and hit conflicts."
112112
echo
113113
echo "#### How to resolve"
114+
echo '```bash'
115+
echo "git fetch origin"
116+
echo "git switch $BRANCH"
117+
echo "git pull origin $BRANCH"
118+
114119
for i in "${!CONFLICTS[@]}"; do
115-
echo '```bash'
116-
if [[ "$i" -eq 0 ]]; then
117-
echo "git fetch origin"
118-
echo "git switch $BRANCH"
119-
echo "git pull origin $BRANCH"
120-
fi
121120
echo "git merge ${CONFLICTS[$i]}"
122121
echo '```'
123122
echo
124123
echo 'Fix the conflicts (for instance with `git mergetool`), then run `git commit` before continuing.'
125124
echo
125+
echo '```bash'
126126
done
127-
echo '```bash'
128127
echo "git push origin $BRANCH"
129128
echo '```'
130129
echo

0 commit comments

Comments
 (0)