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>2013-05-01 00:02:18 +0400
committernulltoken <emeric.fermas@gmail.com>2013-05-03 22:06:34 +0400
commitd6c74d2f7438597efaffd43320422f3d1ac509de (patch)
tree3723760be80a54aef91eecb0dfed93d5fc3a51ca /LibGit2Sharp/GitObjectType.cs
parent82a8d05417dc804c114376140be94ae69e3c5af4 (diff)
Deploy ObjectType to OdbBackend
Sadly, this is a breaking change as there's no way to allow a migration path through the use of an [Obsolete] attribute.
Diffstat (limited to 'LibGit2Sharp/GitObjectType.cs')
-rw-r--r--LibGit2Sharp/GitObjectType.cs21
1 files changed, 21 insertions, 0 deletions
diff --git a/LibGit2Sharp/GitObjectType.cs b/LibGit2Sharp/GitObjectType.cs
index 2b03cb5e..024943e3 100644
--- a/LibGit2Sharp/GitObjectType.cs
+++ b/LibGit2Sharp/GitObjectType.cs
@@ -77,5 +77,26 @@ namespace LibGit2Sharp
throw new InvalidOperationException(string.Format("Cannot map {0} to a TreeEntryTargetType.", type));
}
}
+
+ public static ObjectType ToObjectType(this GitObjectType type)
+ {
+ switch (type)
+ {
+ case GitObjectType.Commit:
+ return ObjectType.Commit;
+
+ case GitObjectType.Tree:
+ return ObjectType.Tree;
+
+ case GitObjectType.Blob:
+ return ObjectType.Blob;
+
+ case GitObjectType.Tag:
+ return ObjectType.Tag;
+
+ default:
+ throw new InvalidOperationException(string.Format("Cannot map {0} to a ObjectType.", type));
+ }
+ }
}
}