Skip to content

Commit 1097dc2

Browse files
committed
Restrict workaround to Windows only.
1 parent 30aedbd commit 1097dc2

File tree

1 file changed

+9
-3
lines changed

1 file changed

+9
-3
lines changed

versioneer.py

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1046,9 +1046,15 @@ def git_pieces_from_vcs(tag_prefix, root, verbose, run_command=run_command):
10461046

10471047
# if there is a tag matching tag_prefix, this yields TAG-NUM-gHEX[-dirty]
10481048
# if there isn't one, this yields HEX[-dirty] (no NUM)
1049-
describe_out, rc = run_command(GITS, ["describe", "--tags", "--dirty",
1050-
"--always", "--long"],
1051-
cwd=root)
1049+
if sys.platform == 'win32':
1050+
describe_out, rc = run_command(GITS, ["describe", "--tags", "--dirty",
1051+
"--always", "--long"],
1052+
cwd=root)
1053+
else:
1054+
describe_out, rc = run_command(GITS, ["describe", "--tags", "--dirty",
1055+
"--always", "--long",
1056+
"--match", "%s*" % tag_prefix],
1057+
cwd=root)
10521058
# --long was added in git-1.5.5
10531059
if describe_out is None:
10541060
raise NotThisMethod("'git describe' failed")

0 commit comments

Comments
 (0)