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 c8b59c7 commit 1f36860Copy full SHA for 1f36860
src/GitVersionCore/LibGitExtensions.cs
@@ -167,15 +167,22 @@ public static IEnumerable<Branch> GetBranchesContainingCommit([NotNull] this Com
167
}
168
169
170
+ private static Dictionary<string, GitObject> _cachedPeeledTarget = new Dictionary<string, GitObject>();
171
+
172
public static GitObject PeeledTarget(this Tag tag)
173
{
174
+ GitObject cachedTarget;
175
+ if(_cachedPeeledTarget.TryGetValue(tag.Target.Sha, out cachedTarget))
176
+ {
177
+ return cachedTarget;
178
+ }
179
var target = tag.Target;
180
181
while (target is TagAnnotation)
182
183
target = ((TagAnnotation)(target)).Target;
184
-
185
+ _cachedPeeledTarget.Add(tag.Target.Sha, target);
186
return target;
187
188
0 commit comments