summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Martín Nieto <carlosmn@github.com>2016-04-12 00:14:00 +0200
committerCarlos Martín Nieto <carlosmn@github.com>2016-04-12 00:14:00 +0200
commita2d3d2d3ace896bfc094ac665c2827d11b9977b7 (patch)
treeab23f78e63924afacb2379a0ef2d1a67e33cf80d
parent0e00eecf83d8811e08024da3becf5159bc9d6226 (diff)
parentbbd65ad27eb5763bf0e9da9ec5e4cb9ed1930c72 (diff)
downloadlibgit2-a2d3d2d3ace896bfc094ac665c2827d11b9977b7.tar.gz
Merge pull request #3738 from ethomson/test_as_root
tests: skip the unreadable file tests as root
-rw-r--r--tests/iterator/workdir.c5
-rw-r--r--tests/status/worktree.c3
2 files changed, 8 insertions, 0 deletions
diff --git a/tests/iterator/workdir.c b/tests/iterator/workdir.c
index c8f795a0d..28fcc0d23 100644
--- a/tests/iterator/workdir.c
+++ b/tests/iterator/workdir.c
@@ -673,6 +673,11 @@ void test_iterator_workdir__skips_unreadable_dirs(void)
if (!cl_is_chmod_supported())
return;
+#ifndef GIT_WIN32
+ if (geteuid() == 0)
+ cl_skip();
+#endif
+
g_repo = cl_git_sandbox_init("empty_standard_repo");
cl_must_pass(p_mkdir("empty_standard_repo/r", 0777));
diff --git a/tests/status/worktree.c b/tests/status/worktree.c
index d3b1dfb29..1345dbfd2 100644
--- a/tests/status/worktree.c
+++ b/tests/status/worktree.c
@@ -1048,6 +1048,9 @@ void test_status_worktree__unreadable(void)
git_status_options opts = GIT_STATUS_OPTIONS_INIT;
status_entry_counts counts = {0};
+ if (geteuid() == 0)
+ cl_skip();
+
/* Create directory with no read permission */
cl_git_pass(git_futils_mkdir_r("empty_standard_repo/no_permission", 0777));
cl_git_mkfile("empty_standard_repo/no_permission/foo", "dummy");