Skip to content

Commit 64329ee

Browse files
authored
Merge branch 'master' into docs-rel-4-8-0
2 parents 4fe11e0 + 8cb7369 commit 64329ee

File tree

1 file changed

+12
-5
lines changed

1 file changed

+12
-5
lines changed

scripts/index-breaking-changes.sh

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -31,13 +31,20 @@ if [ -f "$ALL_VERSIONS_PATH" ] && [ -d "$BREAKING_CHANGES_PARTIALS_PATH" ]; then
3131
fi
3232

3333
# Fetch all branches from the remote
34-
git fetch --prune origin
34+
# Pull *only* version-* branches into refs/remotes/origin/, shallow, skip tags,
35+
# and explicitly exclude version-3-4 with a negative refspec.
36+
git fetch --prune --no-tags --depth=1 --filter=blob:none origin \
37+
'+refs/heads/version-*:refs/remotes/origin/version-*' \
38+
'^refs/heads/version-3-4'
3539

3640
# Get remote version branches (no locals, no HEAD), exclude version-3-4
37-
branches="$(git for-each-ref --format='%(refname:strip=3)' 'refs/remotes/origin/version-*' \
38-
| grep -v '^HEAD$' \
39-
| grep -v '^version-3-4$' \
40-
| sort -u)"
41+
branches="$(
42+
git for-each-ref \
43+
--format='%(refname:strip=3)' \
44+
--sort=refname \
45+
--exclude='refs/remotes/origin/version-3-4' \
46+
'refs/remotes/origin/version-*'
47+
)"
4148

4249
# Remove files for repeatable runs.
4350
rm -rf $BREAKING_CHANGES_PARTIALS_PATH

0 commit comments

Comments
 (0)