summaryrefslogtreecommitdiff
path: root/tests/status/ignore.c
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@microsoft.com>2015-09-16 15:07:27 -0400
committerEdward Thomson <ethomson@edwardthomson.com>2015-09-17 10:00:35 -0400
commitac2fba0ecd68e8eae348dec688cbcd0828432cdf (patch)
tree35921227c4eae6e36a65a90e391966319d9676b2 /tests/status/ignore.c
parentadd0378d8eb76cb7fde92bcbed3eb59ee5b8947c (diff)
downloadlibgit2-ac2fba0ecd68e8eae348dec688cbcd0828432cdf.tar.gz
git_futils_mkdir_*: make a relative-to-base mkdir
Untangle git_futils_mkdir from git_futils_mkdir_ext - the latter assumes that we own everything beneath the base, as if it were being called with a base of the repository or working directory, and is tailored towards checkout and ensuring that there is no bogosity beneath the base that must be cleaned up. This is (at best) slow and (at worst) unsafe in the larger context of a filesystem where we do not own things and cannot do things like unlink symlinks that are in our way.
Diffstat (limited to 'tests/status/ignore.c')
-rw-r--r--tests/status/ignore.c14
1 files changed, 7 insertions, 7 deletions
diff --git a/tests/status/ignore.c b/tests/status/ignore.c
index bbf8f4911..c318046da 100644
--- a/tests/status/ignore.c
+++ b/tests/status/ignore.c
@@ -148,7 +148,7 @@ void test_status_ignore__ignore_pattern_contains_space(void)
cl_git_pass(git_status_file(&flags, g_repo, "foo bar.txt"));
cl_assert(flags == GIT_STATUS_IGNORED);
- cl_git_pass(git_futils_mkdir_r("empty_standard_repo/foo", NULL, mode));
+ cl_git_pass(git_futils_mkdir_r("empty_standard_repo/foo", mode));
cl_git_mkfile("empty_standard_repo/foo/look-ma.txt", "I'm not going to be ignored!");
cl_git_pass(git_status_file(&flags, g_repo, "foo/look-ma.txt"));
@@ -206,7 +206,7 @@ void test_status_ignore__subdirectories(void)
* used a rooted path for an ignore, so I changed this behavior.
*/
cl_git_pass(git_futils_mkdir_r(
- "empty_standard_repo/test/ignore_me", NULL, 0775));
+ "empty_standard_repo/test/ignore_me", 0775));
cl_git_mkfile(
"empty_standard_repo/test/ignore_me/file", "I'm going to be ignored!");
cl_git_mkfile(
@@ -230,9 +230,9 @@ static void make_test_data(const char *reponame, const char **files)
g_repo = cl_git_sandbox_init(reponame);
for (scan = files; *scan != NULL; ++scan) {
- cl_git_pass(git_futils_mkdir(
+ cl_git_pass(git_futils_mkdir_relative(
*scan + repolen, reponame,
- 0777, GIT_MKDIR_PATH | GIT_MKDIR_SKIP_LAST));
+ 0777, GIT_MKDIR_PATH | GIT_MKDIR_SKIP_LAST, NULL));
cl_git_mkfile(*scan, "contents");
}
}
@@ -612,7 +612,7 @@ void test_status_ignore__issue_1766_negated_ignores(void)
g_repo = cl_git_sandbox_init("empty_standard_repo");
cl_git_pass(git_futils_mkdir_r(
- "empty_standard_repo/a", NULL, 0775));
+ "empty_standard_repo/a", 0775));
cl_git_mkfile(
"empty_standard_repo/a/.gitignore", "*\n!.gitignore\n");
cl_git_mkfile(
@@ -622,7 +622,7 @@ void test_status_ignore__issue_1766_negated_ignores(void)
assert_is_ignored("a/ignoreme");
cl_git_pass(git_futils_mkdir_r(
- "empty_standard_repo/b", NULL, 0775));
+ "empty_standard_repo/b", 0775));
cl_git_mkfile(
"empty_standard_repo/b/.gitignore", "*\n!.gitignore\n");
cl_git_mkfile(
@@ -1033,7 +1033,7 @@ void test_status_ignore__negate_starstar(void)
"code/projects/**/packages/*\n"
"!code/projects/**/packages/repositories.config");
- cl_git_pass(git_futils_mkdir_r("code/projects/foo/bar/packages", "empty_standard_repo", 0777));
+ cl_git_pass(git_futils_mkdir_r("empty_standard_repo/code/projects/foo/bar/packages", 0777));
cl_git_mkfile("empty_standard_repo/code/projects/foo/bar/packages/repositories.config", "");
cl_git_pass(git_ignore_path_is_ignored(&ignored, g_repo, "code/projects/foo/bar/packages/repositories.config"));