Skip to content

Commit 7445d51

Browse files
authored
Merge pull request libgit2#6513 from libgit2/ethomson/util_test_root
fs_path: let root run the ownership tests
2 parents c59d519 + 5c1d764 commit 7445d51

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

tests/util/path.c

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,10 @@
22
#include "futils.h"
33
#include "fs_path.h"
44

5+
#ifndef GIT_WIN32
6+
# include <unistd.h>
7+
#endif
8+
59
static char *path_save;
610

711
void test_path__initialize(void)
@@ -757,7 +761,7 @@ void test_path__validate_current_user_ownership(void)
757761
cl_git_fail(git_fs_path_owner_is_current_user(&is_cur, "c:\\path\\does\\not\\exist"));
758762
#else
759763
cl_git_pass(git_fs_path_owner_is_current_user(&is_cur, "/"));
760-
cl_assert_equal_i(is_cur, 0);
764+
cl_assert_equal_i(is_cur, (geteuid() == 0));
761765

762766
cl_git_fail(git_fs_path_owner_is_current_user(&is_cur, "/path/does/not/exist"));
763767
#endif

0 commit comments

Comments
 (0)