diff options
author | Edward Thomson <ethomson@microsoft.com> | 2014-12-18 21:12:05 -0600 |
---|---|---|
committer | Edward Thomson <ethomson@microsoft.com> | 2014-12-18 21:12:05 -0600 |
commit | ddf9d7d4550927b39faddcde0c2b98b5001226b0 (patch) | |
tree | ca8a7995b2add6989d01e38adb311775b604404c | |
parent | 247b3f4ee5d08ee5f5f88eb1c0f6ed03cbd21fc9 (diff) | |
parent | 284283180003a085ce03fb8fac2550a7ac9b9eb0 (diff) | |
download | libgit2-ddf9d7d4550927b39faddcde0c2b98b5001226b0.tar.gz |
Merge branch 'hf/master_patch'
-rw-r--r-- | tests/index/tests.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/tests/index/tests.c b/tests/index/tests.c index a6c4b895c..a63183e10 100644 --- a/tests/index/tests.c +++ b/tests/index/tests.c @@ -325,6 +325,7 @@ static void add_invalid_filename(git_repository *repo, const char *fn) cl_assert(git_index_entrycount(index) == 0); + git_buf_free(&path); git_index_free(index); } @@ -338,6 +339,12 @@ void test_index_tests__add_invalid_filename(void) cl_git_pass(git_repository_init(&repo, "./invalid", 0)); cl_must_pass(p_mkdir("./invalid/subdir", 0777)); + /* cl_git_mkfile() needs the dir to exist */ + if (!git_path_exists("./invalid/.GIT")) + cl_must_pass(p_mkdir("./invalid/.GIT", 0777)); + if (!git_path_exists("./invalid/.GiT")) + cl_must_pass(p_mkdir("./invalid/.GiT", 0777)); + add_invalid_filename(repo, ".git/hello"); add_invalid_filename(repo, ".GIT/hello"); add_invalid_filename(repo, ".GiT/hello"); @@ -395,6 +402,7 @@ static void write_invalid_filename(git_repository *repo, const char *fn_orig) p_unlink(path.ptr); cl_git_pass(git_index_remove_all(index, NULL, NULL, NULL)); + git_buf_free(&path); git_index_free(index); git__free(fn); } |