-
Notifications
You must be signed in to change notification settings - Fork 892
/
Copy pathSubmoduleExtensions.cs
27 lines (25 loc) · 1 KB
/
SubmoduleExtensions.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
namespace LibGit2Sharp
{
/// <summary>
/// Extensions related to submodules
/// </summary>
public static class SubmoduleExtensions
{
private const SubmoduleStatus UnmodifiedMask = ~(SubmoduleStatus.InConfig | SubmoduleStatus.InHead | SubmoduleStatus.InIndex | SubmoduleStatus.InWorkDir);
private const SubmoduleStatus WorkDirDirtyMask = SubmoduleStatus.WorkDirFilesIndexDirty | SubmoduleStatus.WorkDirFilesModified | SubmoduleStatus.WorkDirFilesUntracked;
/// <summary>
/// The submodule is unmodified.
/// </summary>
public static bool IsUnmodified(this SubmoduleStatus @this)
{
return (@this & UnmodifiedMask) == SubmoduleStatus.Unmodified;
}
/// <summary>
/// The submodule working directory is dirty.
/// </summary>
public static bool IsWorkingDirectoryDirty(this SubmoduleStatus @this)
{
return (@this & WorkDirDirtyMask) != SubmoduleStatus.Unmodified;
}
}
}