Commit d73bf243 by Edward Thomson Committed by Carlos Martín Nieto

checkout::tree tests: don't use static buffer

parent 9ae94bcc
...@@ -989,15 +989,18 @@ void test_checkout_tree__filemode_preserved_in_index(void) ...@@ -989,15 +989,18 @@ void test_checkout_tree__filemode_preserved_in_index(void)
mode_t read_filemode(const char *path) mode_t read_filemode(const char *path)
{ {
git_buf fullpath = GIT_BUF_INIT;
struct stat st; struct stat st;
char pathabs[256] = {0}; mode_t result;
strcat(pathabs, clar_sandbox_path()); git_buf_joinpath(&fullpath, "testrepo", path);
strcat(pathabs, "/testrepo/"); cl_must_pass(p_stat(fullpath.ptr, &st));
strcat(pathabs, path);
cl_must_pass(p_stat(pathabs, &st));
return st.st_mode; result = GIT_PERMS_IS_EXEC(st.st_mode) ? 0100755 : 0100644;
git_buf_free(&fullpath);
return result;
} }
void test_checkout_tree__filemode_preserved_in_workdir(void) void test_checkout_tree__filemode_preserved_in_workdir(void)
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment