From fd729fe7583e3ffb4645de521f1d985d7fd1c99b Mon Sep 17 00:00:00 2001 From: Pierre-Yves Chibon Date: Mar 08 2018 10:32:46 +0000 Subject: Check how starts the reference rather than its content Signed-off-by: Pierre-Yves Chibon --- diff --git a/pagure/lib/git.py b/pagure/lib/git.py index f04ca57..7328874 100644 --- a/pagure/lib/git.py +++ b/pagure/lib/git.py @@ -1618,7 +1618,7 @@ def get_git_tags(project, with_commits=False): if with_commits: tags = {} for tag in repo_obj.listall_references(): - if 'refs/tags/' in tag: + if tag.startswith('refs/tags/'): ref = repo_obj.lookup_reference(tag) if ref: com = ref.get_object() @@ -1628,7 +1628,7 @@ def get_git_tags(project, with_commits=False): tags = [ tag.split('refs/tags/')[1] for tag in repo_obj.listall_references() - if 'refs/tags/' in tag + if tag.startswith('refs/tags/') ] return tags