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-06-20 15:41:58 +0400
committernulltoken <emeric.fermas@gmail.com>2011-06-20 22:54:00 +0400
commitaee32ee256722684b88d7e9fbdff4beb21215de8 (patch)
treee862dbd1b0249a3ee04ba8c4e517190af45dfdeb /LibGit2Sharp/ReferenceCollection.cs
parent87879f34a2939107d0c2df598b675f1d7ad148f7 (diff)
Add tests exercising usage of abbreviated shas
Diffstat (limited to 'LibGit2Sharp/ReferenceCollection.cs')
-rw-r--r--LibGit2Sharp/ReferenceCollection.cs10
1 files changed, 10 insertions, 0 deletions
diff --git a/LibGit2Sharp/ReferenceCollection.cs b/LibGit2Sharp/ReferenceCollection.cs
index 6207ce37..1fa74832 100644
--- a/LibGit2Sharp/ReferenceCollection.cs
+++ b/LibGit2Sharp/ReferenceCollection.cs
@@ -101,6 +101,16 @@ namespace LibGit2Sharp
private int CreateDirectReference(string name, ObjectId targetOid, bool allowOverwrite, out IntPtr reference)
{
+ if (targetOid is AbbreviatedObjectId) //TODO: This is hacky... :-/
+ {
+ var obj = repo.Lookup(targetOid);
+ if (obj == null)
+ {
+ Ensure.Success((int) GitErrorCode.GIT_ENOTFOUND);
+ }
+ targetOid = obj.Id;
+ }
+
GitOid oid = targetOid.Oid;
if (allowOverwrite)