diff options
| author | Russell Belfer <rb@github.com> | 2012-08-24 13:41:45 -0700 |
|---|---|---|
| committer | Russell Belfer <rb@github.com> | 2012-08-24 13:41:45 -0700 |
| commit | 1168410426293aef8ce33becb277ff225595e183 (patch) | |
| tree | 745ef945dd714903ebe81f58e9e846d340954f09 /tests-clar | |
| parent | 2eb4edf5f269f60b188ff72d350ee321d1cbaf79 (diff) | |
| download | libgit2-1168410426293aef8ce33becb277ff225595e183.tar.gz | |
Fix crash with adding internal ignores
Depending on what you had done before adding new items to the
internal ignores list, it was possible for the cache of ignore
data to be uninitialized.
Diffstat (limited to 'tests-clar')
| -rw-r--r-- | tests-clar/status/ignore.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/tests-clar/status/ignore.c b/tests-clar/status/ignore.c index 9c6d7ee6..9092d515 100644 --- a/tests-clar/status/ignore.c +++ b/tests-clar/status/ignore.c @@ -199,3 +199,18 @@ void test_status_ignore__adding_internal_ignores(void) cl_git_pass(git_status_should_ignore(&ignored, g_repo, "two.bar")); cl_assert(ignored); } + +void test_status_ignore__add_internal_as_first_thing(void) +{ + int ignored; + const char *add_me = "\n#################\n## Eclipse\n#################\n\n*.pydevproject\n.project\n.metadata\nbin/\ntmp/\n*.tmp\n\n"; + + g_repo = cl_git_sandbox_init("empty_standard_repo"); + + cl_git_pass(git_ignore_add_rule(g_repo, add_me)); + + cl_git_pass(git_status_should_ignore(&ignored, g_repo, "one.tmp")); + cl_assert(ignored); + cl_git_pass(git_status_should_ignore(&ignored, g_repo, "two.bar")); + cl_assert(!ignored); +} |
