Skip to content

Commit f91558b

Browse files
committed
msys2-runtime: operate mostly on the bare msys2-runtime repo
There is also no need to make `src/msys2-runtime` a bare clone; It can simply be a Git worktree. Does not even need the files checked out. Signed-off-by: Johannes Schindelin <[email protected]>
1 parent 45d2a2d commit f91558b

File tree

1 file changed

+13
-11
lines changed

1 file changed

+13
-11
lines changed

update-scripts/version/msys2-runtime

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -32,22 +32,21 @@ git --git-dir=msys2-runtime config remote.origin.partialCloneFilter blob:none &&
3232
git --git-dir=msys2-runtime config remote.origin.fetch 'refs/tags/cygwin-*:refs/tags/cygwin-*' &&
3333
git --git-dir=msys2-runtime fetch origin &&
3434

35-
git clone --bare msys2-runtime src/msys2-runtime &&
36-
git --git-dir=src/msys2-runtime config remote.origin.url https://github.com/git-for-windows/msys2-runtime &&
37-
# pretend to be a partial clone
38-
git --git-dir=src/msys2-runtime config remote.origin.promisor true &&
39-
git --git-dir=src/msys2-runtime config remote.origin.partialCloneFilter blob:none ||
40-
die "Failed to initialize the src/msys2-runtime repository"
35+
git --git-dir=msys2-runtime config remote.g4w.url https://github.com/git-for-windows/msys2-runtime &&
36+
# pretend to be a partially-cloned remote, too
37+
git --git-dir=msys2-runtime config remote.g4w.promisor true &&
38+
git --git-dir=msys2-runtime config remote.g4w.partialCloneFilter blob:none &&
39+
git --git-dir=msys2-runtime fetch g4w $revision ||
40+
die "Failed to initialize the msys2-runtime repository"
4141

42-
git --git-dir=src/msys2-runtime reset --soft "$revision" &&
4342
previous_commit="$(cat msys2-runtime.commit)" && {
44-
test 0 = $(git --git-dir=src/msys2-runtime rev-list --count "$revision..$previous_commit") ||
43+
test 0 = $(git --git-dir=msys2-runtime rev-list --count "$revision..$previous_commit") ||
4544
die "The revision $revision is not a direct descendant of $previous_commit"
4645
} &&
4746

4847
# update pkgver if needed
4948
update_pkgver= &&
50-
pkgver=$(git --git-dir=src/msys2-runtime describe --match='cygwin-[0-9]*' "$revision") &&
49+
pkgver=$(git --git-dir=msys2-runtime describe --match='cygwin-[0-9]*' "$revision") &&
5150
pkgver=${pkgver#cygwin-} &&
5251
pkgver=${pkgver%%-*} &&
5352
if test "$pkgver" != "$(sed -n 's/^pkgver=\(.*\)/\1/p' PKGBUILD)"
@@ -60,15 +59,18 @@ then
6059
fi &&
6160

6261
# pre-fetch the required blobs
63-
git --git-dir=src/msys2-runtime fetch origin \
64-
$(git --git-dir=src/msys2-runtime -c core.abbrev=no \
62+
git --git-dir=msys2-runtime fetch g4w \
63+
$(git --git-dir=msys2-runtime -c core.abbrev=no \
6564
log --format='%n' --raw "refs/tags/cygwin-$pkgver..$revision" ^"$revision^{/^Start.the.merging-rebase}" |
6665
cut -d ' ' -f 3,4 |
6766
tr ' ' '\n' |
6867
grep -v '^0*$' |
6968
sort |
7069
uniq) &&
7170

71+
git --git-dir=msys2-runtime reset --soft "$revision" &&
72+
git --git-dir=msys2-runtime worktree add --no-checkout src/msys2-runtime &&
73+
7274
sh -x ./update-patches.sh &&
7375
if test -n "$update_pkgver"
7476
then

0 commit comments

Comments
 (0)