-
Notifications
You must be signed in to change notification settings - Fork 892
/
Copy pathTreeEntryTargetType.cs
47 lines (41 loc) · 1.25 KB
/
TreeEntryTargetType.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
using System;
using System.Globalization;
using LibGit2Sharp.Core;
namespace LibGit2Sharp
{
/// <summary>
/// Underlying type of the target a <see cref="TreeEntry"/>
/// </summary>
public enum TreeEntryTargetType
{
/// <summary>
/// A file revision object.
/// </summary>
Blob,
/// <summary>
/// A tree object.
/// </summary>
Tree,
/// <summary>
/// A pointer to a commit object in another repository.
/// </summary>
GitLink,
}
internal static class TreeEntryTargetTypeExtensions
{
public static GitObjectType ToGitObjectType(this TreeEntryTargetType type)
{
switch (type)
{
case TreeEntryTargetType.Tree:
return GitObjectType.Tree;
case TreeEntryTargetType.Blob:
return GitObjectType.Blob;
default:
throw new InvalidOperationException(string.Format(CultureInfo.InvariantCulture,
"Cannot map {0} to a GitObjectType.",
type));
}
}
}
}