Skip to content

Commit 0b4e541

Browse files
committed
Add some more test coverage demonstrating the handling of .gitgnore file
1 parent d9e3dbc commit 0b4e541

File tree

2 files changed

+6
-2
lines changed

2 files changed

+6
-2
lines changed

LibGit2Sharp.Tests/StatusFixture.cs

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -146,6 +146,8 @@ public void RetrievingTheStatusOfTheRepositoryHonorsTheGitIgnoreDirectives()
146146

147147
RepositoryStatus newStatus = repo.Index.RetrieveStatus();
148148
newStatus.Untracked.Single().ShouldEqual(".gitignore");
149+
150+
repo.Index.RetrieveStatus(relativePath).ShouldEqual(FileStatus.Ignored);
149151
}
150152
}
151153
}

LibGit2Sharp/FileStatus.cs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -45,7 +45,9 @@ public enum FileStatus
4545
/// </summary>
4646
Missing = (1 << 5), /* GIT_STATUS_WT_DELETED */
4747

48-
//TODO: Ignored files not handled yet
49-
GIT_STATUS_IGNORED = (1 << 6), /* GIT_STATUS_IGNORED */
48+
/// <summary>
49+
/// The file is <see cref="Untracked"/> but its name and/or path macthes an exclude pattern in a <c>gitignore</c> file.
50+
/// </summary>
51+
Ignored = (1 << 6), /* GIT_STATUS_IGNORED */
5052
}
5153
}

0 commit comments

Comments
 (0)