mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-29 18:38:58 +00:00
Merge pull request #3738 from ethomson/test_as_root
tests: skip the unreadable file tests as root
This commit is contained in:
commit
a2d3d2d3ac
@ -673,6 +673,11 @@ void test_iterator_workdir__skips_unreadable_dirs(void)
|
|||||||
if (!cl_is_chmod_supported())
|
if (!cl_is_chmod_supported())
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
#ifndef GIT_WIN32
|
||||||
|
if (geteuid() == 0)
|
||||||
|
cl_skip();
|
||||||
|
#endif
|
||||||
|
|
||||||
g_repo = cl_git_sandbox_init("empty_standard_repo");
|
g_repo = cl_git_sandbox_init("empty_standard_repo");
|
||||||
|
|
||||||
cl_must_pass(p_mkdir("empty_standard_repo/r", 0777));
|
cl_must_pass(p_mkdir("empty_standard_repo/r", 0777));
|
||||||
|
@ -1048,6 +1048,9 @@ void test_status_worktree__unreadable(void)
|
|||||||
git_status_options opts = GIT_STATUS_OPTIONS_INIT;
|
git_status_options opts = GIT_STATUS_OPTIONS_INIT;
|
||||||
status_entry_counts counts = {0};
|
status_entry_counts counts = {0};
|
||||||
|
|
||||||
|
if (geteuid() == 0)
|
||||||
|
cl_skip();
|
||||||
|
|
||||||
/* Create directory with no read permission */
|
/* Create directory with no read permission */
|
||||||
cl_git_pass(git_futils_mkdir_r("empty_standard_repo/no_permission", 0777));
|
cl_git_pass(git_futils_mkdir_r("empty_standard_repo/no_permission", 0777));
|
||||||
cl_git_mkfile("empty_standard_repo/no_permission/foo", "dummy");
|
cl_git_mkfile("empty_standard_repo/no_permission/foo", "dummy");
|
||||||
|
Loading…
Reference in New Issue
Block a user