Skip to content

Commit 3329724

Browse files
committed
TO-SPLIT
Signed-off-by: Johannes Schindelin <johannes.schindelin@gmx.de>
1 parent 4e526a2 commit 3329724

2 files changed

Lines changed: 6 additions & 13 deletions

File tree

.github/workflows/rebase-shears.yml

Lines changed: 5 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -87,12 +87,9 @@ jobs:
8787
exit 0
8888
fi
8989
90-
echo "::group::Rebasing shears/$BRANCH"
9190
if ./ci/rebase-branch.sh "shears/$BRANCH" "$UPSTREAM" ./ci; then
92-
echo "::endgroup::"
9391
echo "to_push=shears/$BRANCH" >>"$GITHUB_OUTPUT"
9492
else
95-
echo "::endgroup::"
9693
echo "failed_worktrees=$PWD/rebase-worktree-$BRANCH" >>"$GITHUB_OUTPUT"
9794
exit 1
9895
fi
@@ -124,12 +121,9 @@ jobs:
124121
fi
125122
126123
worktree="$PWD/rebase-worktree-$BRANCH"
127-
echo "::group::Rebasing shears/$BRANCH"
128124
if ./ci/rebase-branch.sh "shears/$BRANCH" "$UPSTREAM" ./ci; then
129-
echo "::endgroup::"
130125
to_push="${to_push:+$to_push }shears/$BRANCH"
131126
else
132-
echo "::endgroup::"
133127
echo "::error::Rebase failed for shears/$BRANCH"
134128
failed_worktrees="${failed_worktrees:+$failed_worktrees }$worktree"
135129
fi
@@ -160,13 +154,13 @@ jobs:
160154
for worktree in ${{ steps.rebase-single.outputs.failed_worktrees }} ${{ steps.rebase-all.outputs.failed_worktrees }}; do
161155
test -d "$worktree" || continue
162156
name=${worktree##*rebase-worktree-}
163-
cd "$worktree"
164-
git for-each-ref --format='%(refname)' |
157+
# Include REBASE_HEAD if it exists
158+
git -C "$worktree" rev-parse --verify REBASE_HEAD && rebase_head_arg=REBASE_HEAD || rebase_head_arg=
159+
git -C "$worktree" for-each-ref --format='%(refname)' |
165160
grep -v '^refs/tags/' |
166161
sed 's,^refs/remotes/origin/,^refs/remotes/origin/,' |
167-
git bundle create "$GITHUB_WORKSPACE/upload/$name.bundle" --stdin HEAD
168-
tar -czf "$GITHUB_WORKSPACE/upload/$name.tar.gz" .
169-
cd "$GITHUB_WORKSPACE"
162+
git -C "$worktree" bundle create "../upload/$name.bundle" --stdin HEAD $rebase_head_arg
163+
tar -czf "upload/$name.tar.gz" -C "$worktree" .
170164
done
171165
172166
- name: Upload bundles and worktrees

ci/rebase-branch.sh

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -81,7 +81,6 @@ generate_log_l_commands () {
8181
echo "$commands"
8282
}
8383

84-
# Function to create recovery bundle on failure
8584
# Function to resolve a single conflict with AI
8685
resolve_conflict_with_ai () {
8786
# Get REBASE_HEAD info once
@@ -411,7 +410,7 @@ REBASE_TODO_COUNT=$(git rev-list --count "$OLD_MARKER..$TIP_OID")
411410
echo "Rebasing $REBASE_TODO_COUNT commits onto $MARKER_OID"
412411
echo "::endgroup::"
413412

414-
run_rebase_with_ai -r --onto "$MARKER_OID" "$OLD_MARKER" HEAD
413+
run_rebase_with_ai -r --onto "$MARKER_OID" "$OLD_MARKER"
415414

416415
# Clean up graft and verify
417416
git replace -d "$MARKER_OID"

0 commit comments

Comments
 (0)