Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2sharp.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authornulltoken <emeric.fermas@gmail.com>2011-09-13 17:43:52 +0400
committernulltoken <emeric.fermas@gmail.com>2011-09-14 19:21:43 +0400
commitfef3488bf1603325789f144edd61a276bbc470f0 (patch)
tree58ffb9f172e72fc87f471f64c1fd962780ec7e0f /LibGit2Sharp/Reference.cs
parente44e2c2902998569ec4b0eb3c541e1ef863aaa3f (diff)
Defer loading of the tip of a Branch
Diffstat (limited to 'LibGit2Sharp/Reference.cs')
-rw-r--r--LibGit2Sharp/Reference.cs5
1 files changed, 3 insertions, 2 deletions
diff --git a/LibGit2Sharp/Reference.cs b/LibGit2Sharp/Reference.cs
index c063cfaf..8570b9fb 100644
--- a/LibGit2Sharp/Reference.cs
+++ b/LibGit2Sharp/Reference.cs
@@ -70,16 +70,17 @@ namespace LibGit2Sharp
return reference as T;
}
- GitObject targetGitObject = repo.Lookup(targetIdentifier);
+ var targetOid = new ObjectId(targetIdentifier);
if (Equals(typeof(T), typeof(Tag)))
{
+ GitObject targetGitObject = repo.Lookup(targetIdentifier);
return new Tag(reference.CanonicalName, targetGitObject, targetGitObject as TagAnnotation) as T;
}
if (Equals(typeof(T), typeof(Branch)))
{
- return new Branch(reference.CanonicalName, targetGitObject as Commit, repo) as T;
+ return new Branch(reference.CanonicalName, targetOid, repo) as T;
}
throw new InvalidOperationException(