Skip to content

Commit 32b9f5a

Browse files
author
Matthias Koeppe
committed
.ci/merge-fixes.sh: Unshallow for merge
1 parent a9d84a8 commit 32b9f5a

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

.ci/merge-fixes.sh

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
#!/bin/sh
22
# Merge open PRs from sagemath/sage labeled "blocker".
3-
GH="gh -R sagemath/sage"
3+
REPO="sagemath/sage"
4+
GH="gh -R $REPO"
45
PRs="$($GH pr list --label "p: blocker / 1" --json number --jq '.[].number')"
56
if [ -z "$PRs" ]; then
67
echo 'Nothing to do: Found no open PRs with "blocker" status.'
@@ -13,10 +14,11 @@ else
1314
git commit -q -m "Uncommitted changes" --no-allow-empty -a
1415
git tag -f test_head
1516
for a in $PRs; do
16-
echo "::group::Merging PR #$a"
17-
$GH pr checkout $a
17+
echo "::group::Merging PR https://github.com/$REPO/pull/$a"
18+
$GH pr checkout -b pr-$a $a
19+
git fetch --unshallow --all
1820
git checkout -q test_head
19-
if git merge --no-edit -q FETCH_HEAD; then
21+
if git merge --no-edit -q pr-$a; then
2022
echo "::endgroup::"
2123
echo "Merged #$a"
2224
else
@@ -25,4 +27,5 @@ else
2527
git reset --hard
2628
fi
2729
done
30+
git log test_head..HEAD
2831
fi

0 commit comments

Comments
 (0)