1
0
mirror of https://github.com/openSUSE/osc.git synced 2025-01-13 09:16:14 +01: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:
Daniel Mach 2022-07-07 13:40:08 +02:00 committed by GitHub
commit dba4041af0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

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