1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-09-06 13:18:42 +02:00

Merge pull request #1066 from dmach/fix-git-version-github

Fix detecting version from git in archives from GitHub
This commit is contained in:
2022-07-07 13:40:08 +02:00
committed by GitHub

View File

@@ -10,8 +10,9 @@ def get_git_archive_version():
# the `version` variable contents get substituted during `git archive`
# it requires adding this to .gitattributes: <path to this file> export-subst
version = "$Format:%(describe:tags=true)$"
if version.startswith("$"):
# version hasn't been substituted during `git archive`
if version.startswith(("$", "%")):
# "$": version hasn't been substituted during `git archive`
# "%": "Format:" and "$" characters get removed from the version string (a GitHub bug?)
return None
return version