diff options
author | Keith Dahlby <dahlbyk@gmail.com> | 2011-10-02 19:09:04 +0400 |
---|---|---|
committer | nulltoken <emeric.fermas@gmail.com> | 2011-10-07 20:54:08 +0400 |
commit | 18c77d6013caa7daafb8b8b14bd3d637bf5e6192 (patch) | |
tree | 983bd84e6a14e259c4d50b5b7a3c599f5575dfef /LibGit2Sharp/RepositoryStatus.cs | |
parent | 7dc1d79e0921362ecbff7e28c86aada997e7bd45 (diff) |
Clean up RepositoryStatus
Diffstat (limited to 'LibGit2Sharp/RepositoryStatus.cs')
-rw-r--r-- | LibGit2Sharp/RepositoryStatus.cs | 13 |
1 files changed, 2 insertions, 11 deletions
diff --git a/LibGit2Sharp/RepositoryStatus.cs b/LibGit2Sharp/RepositoryStatus.cs index ba3ae792..d0863634 100644 --- a/LibGit2Sharp/RepositoryStatus.cs +++ b/LibGit2Sharp/RepositoryStatus.cs @@ -20,8 +20,6 @@ namespace LibGit2Sharp private readonly List<string> untracked = new List<string>(); private readonly bool isDirty; - private readonly NativeMethods.status_callback callback; - private readonly IDictionary<FileStatus, Action<RepositoryStatus, string>> dispatcher = Build(); private static IDictionary<FileStatus, Action<RepositoryStatus, string>> Build() @@ -37,19 +35,12 @@ namespace LibGit2Sharp }; } - internal RepositoryStatus(RepositorySafeHandle handle) + internal RepositoryStatus(Repository repo) { - callback = new NativeMethods.status_callback(StateChanged); - Process(handle); + Ensure.Success(NativeMethods.git_status_foreach(repo.Handle, StateChanged, IntPtr.Zero)); isDirty = statusEntries.Count != 0; } - private void Process(RepositorySafeHandle handle) - { - int res = NativeMethods.git_status_foreach(handle, callback, IntPtr.Zero); - Ensure.Success(res); - } - private int StateChanged(string filePath, uint state, IntPtr payload) { var gitStatus = (FileStatus)state; |