Skip to content

Commit 2539d17

Browse files
committed
IsStagedToIndex
1 parent 8effe57 commit 2539d17

File tree

1 file changed

+17
-0
lines changed

1 file changed

+17
-0
lines changed

LibGit2Sharp/StatusEntry.cs

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
using System;
22
using System.Diagnostics;
33
using LibGit2Sharp.Core;
4+
using LibGit2Sharp.Core.Compat;
45

56
namespace LibGit2Sharp
67
{
@@ -99,5 +100,21 @@ private string DebuggerDisplay
99100
{
100101
get { return string.Format("{0}: {1}", State, FilePath); }
101102
}
103+
104+
public static readonly FileStatus StagedStatuses =
105+
FileStatus.Added |
106+
FileStatus.Staged |
107+
FileStatus.Removed |
108+
FileStatus.StagedTypeChange |
109+
FileStatus.Renamed;
110+
111+
public bool IsStaged
112+
{
113+
get
114+
{
115+
return StagedStatuses.HasFlag(State);
116+
117+
}
118+
}
102119
}
103120
}

0 commit comments

Comments
 (0)