diff options
author | Keith Dahlby <dahlbyk@gmail.com> | 2013-01-30 07:08:52 +0400 |
---|---|---|
committer | nulltoken <emeric.fermas@gmail.com> | 2013-01-30 17:32:26 +0400 |
commit | 30d33b21a65ced43aef3406468fe6581a498f8cf (patch) | |
tree | 34b24172847890f44840a1b8e4b2d7ac310dee26 | |
parent | aa5d87d0261aa6339910c4d9588122a6ee9d4458 (diff) |
Claim last bit for FileStatus.Nonexistent
Fix #307
Also, remove comment reference to GIT_STATUS_NOTFOUND which, ironically, does not exist
-rw-r--r-- | LibGit2Sharp.Tests/StatusFixture.cs | 15 | ||||
-rw-r--r-- | LibGit2Sharp/FileStatus.cs | 2 |
2 files changed, 16 insertions, 1 deletions
diff --git a/LibGit2Sharp.Tests/StatusFixture.cs b/LibGit2Sharp.Tests/StatusFixture.cs index cd656895..a5e3520e 100644 --- a/LibGit2Sharp.Tests/StatusFixture.cs +++ b/LibGit2Sharp.Tests/StatusFixture.cs @@ -10,6 +10,21 @@ namespace LibGit2Sharp.Tests public class StatusFixture : BaseFixture { [Fact] + public void FileStatusFlagsAreMutuallyExclusive() + { + var overlaps = from FileStatus x in Enum.GetValues(typeof(FileStatus)) + where x != default(FileStatus) + from FileStatus y in Enum.GetValues(typeof(FileStatus)) + where y != default(FileStatus) + where x != y && (x & y) == y + select string.Format("{0} overlaps with {1}", x, y); + + var message = string.Join(Environment.NewLine, overlaps.ToArray()); + + Assert.Equal("", message); + } + + [Fact] public void CanRetrieveTheStatusOfAFile() { using (var repo = new Repository(StandardTestRepoPath)) diff --git a/LibGit2Sharp/FileStatus.cs b/LibGit2Sharp/FileStatus.cs index 4d663fd0..c0d2df00 100644 --- a/LibGit2Sharp/FileStatus.cs +++ b/LibGit2Sharp/FileStatus.cs @@ -11,7 +11,7 @@ namespace LibGit2Sharp /// <summary> /// The file doesn't exist. /// </summary> - Nonexistent = -1, /* GIT_STATUS_NOTFOUND */ + Nonexistent = (1 << 31), /// <summary> /// The file hasn't been modified. |