Skip to content

Commit d896795

Browse files
authored
CXX-3099 use for-each-ref for Git 2.43 compatibility (#1384)
1 parent f5c55af commit d896795

File tree

2 files changed

+4
-2
lines changed

2 files changed

+4
-2
lines changed

etc/calc_release_version.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -250,10 +250,12 @@ def iter_tag_lines():
250250
the second is a tag that is associated with that commit. Duplicate commits
251251
are possible.
252252
"""
253-
output = check_output(['git', 'tag', '--list', '--format=%(*objectname)|%(objectname)|%(refname:strip=2)'])
253+
output = check_output(['git', 'for-each-ref', '--format=%(*objectname)|%(objectname)|%(refname:strip=2)', 'refs/tags/*'])
254254
lines = output.splitlines()
255255
for l in lines:
256256
obj, tagobj, tag = l.split('|', 2)
257+
if not tag.startswith('r'):
258+
continue # We only care about "rX.Y.Z" release tags.
257259
if re.match(r'r\d+\.\d+', tag):
258260
yield obj, tagobj, tag
259261

etc/calc_release_version_selftest.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -67,7 +67,7 @@ echo "Test next minor version ... begin"
6767
# failed, then it is probably because a new major/minor release was made.
6868
# Update the expected output to represent the correct next version.
6969
# XXX NOTE XXX NOTE XXX
70-
assert_eq "$got" "3.10.0-$DATE+git$CURRENT_SHORTREF"
70+
assert_eq "$got" "4.1.0-$DATE+git$CURRENT_SHORTREF"
7171
}
7272
echo "Test next minor version ... end"
7373

0 commit comments

Comments
 (0)