Skip to content

Commit 99abb02

Browse files
authored
Don't add git hash to version if minor==0 (#409)
This commit fixes a minor mistake from #392 where the previous perl script had a special case that if the "minor" version was zero then the git hash information wouldn't be printed.
1 parent b4f426a commit 99abb02

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

version.py

+3-3
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ def parse_git_version(version):
3939
next = parts.pop(0)
4040
if next == 'm':
4141
dirty = True
42-
else:
42+
elif minor != '0':
4343
git = next[1:]
4444

4545
# Check: dirty.
@@ -53,10 +53,10 @@ def parse_git_version(version):
5353

5454
# Some inline tests to check Git version parsing:
5555
assert parse_git_version(
56-
'wasi-sdk-21-0-g317548590b40+m') == ('21', '0', '317548590b40', True)
56+
'wasi-sdk-21-1-g317548590b40+m') == ('21', '1', '317548590b40', True)
5757
assert parse_git_version('wasi-sdk-21-2+m') == ('21', '2', None, True)
5858
assert parse_git_version(
59-
'wasi-sdk-23-0-g317548590b40') == ('23', '0', '317548590b40', False)
59+
'wasi-sdk-23-0-g317548590b40') == ('23', '0', None, False)
6060

6161

6262
def git_version():

0 commit comments

Comments
 (0)