We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 13a4d67 commit 0348714Copy full SHA for 0348714
lib/git/object.rb
@@ -249,11 +249,16 @@ class Tag < AbstractObject
249
def initialize(base, sha, name)
250
super(base, sha)
251
@name = name
252
+ @annotated = nil
253
end
254
255
def tag?
256
true
257
258
+
259
+ def annotated?
260
+ @annotated ||= (@base.lib.object_type(self.name) == 'tag')
261
+ end
262
263
264
tests/units/test_tags.rb
@@ -54,6 +54,9 @@ def test_tags
54
assert_raise Git::GitTagNameDoesNotExist do
55
r2.tag('third')
56
57
58
+ assert_true(r2.tag('fourth').annotated?)
59
+ assert_false(r2.tag('fifth').annotated?)
60
61
62
0 commit comments