Skip to content

Commit 2459b0f

Browse files
committed
Subtree update automation: update submodules
Update submodules to the exact version that upstream uses at the commit that we are trying to merge towards. We never modify the contents of submodules, so we don't need to make any attempt to merge changes and instead can directly pick the right upstream version.
1 parent 9949c4a commit 2459b0f

File tree

1 file changed

+7
-0
lines changed

1 file changed

+7
-0
lines changed

.github/workflows/update-subtree.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -110,6 +110,8 @@ jobs:
110110
fi
111111
112112
git checkout ${NEXT_COMMIT_HASH}
113+
git submodule update --init -- library/
114+
git submodule status -- library/ > ../submodule-heads
113115
/usr/bin/time -v ../splitsh-lite/splitsh-lite --progress --prefix=library --target subtree/library
114116
git checkout -b subtree/library subtree/library
115117
@@ -187,6 +189,11 @@ jobs:
187189
NEW_SUBTREE_HEAD=$(git rev-parse subtree/library)
188190
echo "NEW_SUBTREE_HEAD=${NEW_SUBTREE_HEAD}" >> $GITHUB_ENV
189191
192+
git submodule foreach 'git fetch'
193+
git submodule foreach 'git fetch; grep $sm_path $toplevel/../submodule-heads | cut -f2 -d" " | xargs git checkout'
194+
git -c user.name=gitbot -c user.email=git@bot \
195+
commit -m "Update submodules" library/
196+
190197
sed -i "s/^channel = \"nightly-.*\"/channel = \"nightly-${NEXT_TOOLCHAIN_DATE}\"/" rust-toolchain.toml
191198
git -c user.name=gitbot -c user.email=git@bot \
192199
commit -m "Update toolchain to ${NEXT_TOOLCHAIN_DATE}" rust-toolchain.toml

0 commit comments

Comments
 (0)