summaryrefslogtreecommitdiff
path: root/tests/filter/systemattrs.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/filter/systemattrs.c')
-rw-r--r--tests/filter/systemattrs.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/tests/filter/systemattrs.c b/tests/filter/systemattrs.c
index 4996b3b1e..b687b4b44 100644
--- a/tests/filter/systemattrs.c
+++ b/tests/filter/systemattrs.c
@@ -3,29 +3,33 @@
#include "path.h"
static git_repository *g_repo = NULL;
-static git_buf system_attr_path = GIT_BUF_INIT;
+static git_str system_attr_path = GIT_STR_INIT;
void test_filter_systemattrs__initialize(void)
{
+ git_buf system_path = GIT_BUF_INIT;
+
g_repo = cl_git_sandbox_init("crlf");
cl_must_pass(p_unlink("crlf/.gitattributes"));
cl_git_pass(git_libgit2_opts(
- GIT_OPT_GET_SEARCH_PATH, GIT_CONFIG_LEVEL_SYSTEM, &system_attr_path));
- cl_git_pass(git_buf_joinpath(&system_attr_path,
- system_attr_path.ptr, "gitattributes"));
+ GIT_OPT_GET_SEARCH_PATH, GIT_CONFIG_LEVEL_SYSTEM, &system_path));
+ cl_git_pass(git_str_joinpath(&system_attr_path,
+ system_path.ptr, "gitattributes"));
cl_git_mkfile(system_attr_path.ptr,
"*.txt text\n"
"*.bin binary\n"
"*.crlf text eol=crlf\n"
"*.lf text eol=lf\n");
+
+ git_buf_dispose(&system_path);
}
void test_filter_systemattrs__cleanup(void)
{
cl_must_pass(p_unlink(system_attr_path.ptr));
- git_buf_dispose(&system_attr_path);
+ git_str_dispose(&system_attr_path);
cl_git_sandbox_cleanup();
}