diff options
| author | Philip Kelley <phkelley@hotmail.com> | 2012-10-08 16:32:43 -0400 |
|---|---|---|
| committer | Philip Kelley <phkelley@hotmail.com> | 2012-10-08 16:32:43 -0400 |
| commit | edb456c32890f329bac59cba1286c0bf44ab6078 (patch) | |
| tree | b8c93b6cd333290a899363e58f6bccd2ad30471c /tests-clar | |
| parent | acd1700630ea1159a55dc5e8cee12e4a725afe18 (diff) | |
| download | libgit2-edb456c32890f329bac59cba1286c0bf44ab6078.tar.gz | |
Fix a bug where ignorecase wasn't applied to ignores
Diffstat (limited to 'tests-clar')
| -rw-r--r-- | tests-clar/status/ignore.c | 21 |
1 files changed, 21 insertions, 0 deletions
diff --git a/tests-clar/status/ignore.c b/tests-clar/status/ignore.c index 9092d5155..d18ba78fc 100644 --- a/tests-clar/status/ignore.c +++ b/tests-clar/status/ignore.c @@ -1,6 +1,7 @@ #include "clar_libgit2.h" #include "fileops.h" #include "git2/attr.h" +#include "ignore.h" #include "attr.h" #include "status_helpers.h" @@ -152,6 +153,26 @@ void test_status_ignore__ignore_pattern_contains_space(void) cl_assert(flags == GIT_STATUS_WT_NEW); } +void test_status_ignore__ignore_pattern_ignorecase(void) +{ + unsigned int flags; + const mode_t mode = 0777; + bool ignore_case; + git_index *index; + + g_repo = cl_git_sandbox_init("empty_standard_repo"); + cl_git_rewritefile("empty_standard_repo/.gitignore", "a.txt\n"); + + cl_git_mkfile("empty_standard_repo/A.txt", "Differs in case"); + + cl_git_pass(git_repository_index(&index, g_repo)); + ignore_case = index->ignore_case; + git_index_free(index); + + cl_git_pass(git_status_file(&flags, g_repo, "A.txt")); + cl_assert(flags == ignore_case ? GIT_STATUS_IGNORED : GIT_STATUS_WT_NEW); +} + void test_status_ignore__adding_internal_ignores(void) { int ignored; |
