Skip to content

Commit fe79c92

Browse files
authored
Merge pull request #3441 from rtfd/fix-git
Fix git
2 parents 59d8f92 + 092d8ae commit fe79c92

File tree

1 file changed

+2
-10
lines changed
  • readthedocs/vcs_support/backends

1 file changed

+2
-10
lines changed

readthedocs/vcs_support/backends/git.py

+2-10
Original file line numberDiff line numberDiff line change
@@ -80,23 +80,15 @@ def clone(self):
8080

8181
@property
8282
def tags(self):
83-
# Hash for non-annotated tag is its commit hash, but for annotated tag it
84-
# points to tag itself, so we need to dereference annotated tags.
85-
# The output format is the same as `git show-ref --tags`, but with hashes
86-
# of annotated tags pointing to tagged commits.
87-
retcode, stdout, _ = self.run(
88-
'git', 'for-each-ref',
89-
'--format=%(if)%(*objectname)%(then)%(*objectname)'
90-
'%(else)%(objectname)%(end) %(refname)',
91-
'refs/tags')
83+
retcode, stdout, _ = self.run('git', 'show-ref', '--tags')
9284
# error (or no tags found)
9385
if retcode != 0:
9486
return []
9587
return self.parse_tags(stdout)
9688

9789
def parse_tags(self, data):
9890
"""
99-
Parses output of `git show-ref --tags`, eg:
91+
Parses output of show-ref --tags, eg:
10092
10193
3b32886c8d3cb815df3793b3937b2e91d0fb00f1 refs/tags/2.0.0
10294
bd533a768ff661991a689d3758fcfe72f455435d refs/tags/2.0.1

0 commit comments

Comments
 (0)