summaryrefslogtreecommitdiff
path: root/tests/core/stat.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/core/stat.c')
-rw-r--r--tests/core/stat.c17
1 files changed, 17 insertions, 0 deletions
diff --git a/tests/core/stat.c b/tests/core/stat.c
index 2e4abfb79..bd9b990e3 100644
--- a/tests/core/stat.c
+++ b/tests/core/stat.c
@@ -95,3 +95,20 @@ void test_core_stat__0(void)
cl_assert_error(ENOTDIR);
}
+void test_core_stat__root(void)
+{
+ const char *sandbox = clar_sandbox_path();
+ git_buf root = GIT_BUF_INIT;
+ int root_len;
+ struct stat st;
+
+ root_len = git_path_root(sandbox);
+ cl_assert(root_len >= 0);
+
+ git_buf_set(&root, sandbox, root_len+1);
+
+ cl_must_pass(p_stat(root.ptr, &st));
+ cl_assert(S_ISDIR(st.st_mode));
+
+ git_buf_free(&root);
+}