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:
authorJohn Gozde <johng@pandell.com>2012-05-18 01:30:31 +0400
committernulltoken <emeric.fermas@gmail.com>2012-05-20 13:36:56 +0400
commita23d735babc60584e611627743716b3bb4708616 (patch)
tree62068ecefbfcfb6f0759040803946f135d2fcbbf
parente8fe68a894d62fe6a6f790a2f2ce2dc0e1270366 (diff)
Prevent IsDirty from looking at ignored files.
-rw-r--r--LibGit2Sharp/RepositoryStatus.cs3
1 files changed, 2 insertions, 1 deletions
diff --git a/LibGit2Sharp/RepositoryStatus.cs b/LibGit2Sharp/RepositoryStatus.cs
index 5b6964d3..237d8a4f 100644
--- a/LibGit2Sharp/RepositoryStatus.cs
+++ b/LibGit2Sharp/RepositoryStatus.cs
@@ -1,6 +1,7 @@
using System;
using System.Collections;
using System.Collections.Generic;
+using System.Linq;
using LibGit2Sharp.Core;
namespace LibGit2Sharp
@@ -40,7 +41,7 @@ namespace LibGit2Sharp
internal RepositoryStatus(Repository repo)
{
Ensure.Success(NativeMethods.git_status_foreach(repo.Handle, StateChanged, IntPtr.Zero));
- isDirty = statusEntries.Count != 0;
+ isDirty = statusEntries.Any(entry => entry.State != FileStatus.Ignored);
}
private int StateChanged(FilePath filePath, uint state, IntPtr payload)