summaryrefslogtreecommitdiff
path: root/tests-clar/repo
diff options
context:
space:
mode:
authorRussell Belfer <rb@github.com>2013-09-05 12:01:17 -0700
committerRussell Belfer <rb@github.com>2013-09-05 12:01:17 -0700
commitaf22dabb4366f8b2dd4acd5725a25e88842d6938 (patch)
tree91221d88877c7ca73d0373f6d42def58f21397db /tests-clar/repo
parentc97d407d9cc54fc99af0a57e09e04e9e0bc68cb6 (diff)
downloadlibgit2-af22dabb4366f8b2dd4acd5725a25e88842d6938.tar.gz
GIT_MODE_TYPE should exclude setgid bits
The GIT_MODE_TYPE macro was looking at all bits above the permissions, but it should really just look at the top bits so that it will give the right results for a setgid or setuid entry. Since we're now using these macros in the tests, this was causing a test failure on platforms that don't support setgid.
Diffstat (limited to 'tests-clar/repo')
-rw-r--r--tests-clar/repo/init.c8
1 files changed, 2 insertions, 6 deletions
diff --git a/tests-clar/repo/init.c b/tests-clar/repo/init.c
index d7f2524c8..43bd7afe0 100644
--- a/tests-clar/repo/init.c
+++ b/tests-clar/repo/init.c
@@ -418,12 +418,8 @@ static void assert_mode_seems_okay(
expect_setgid = false;
}
- if (S_ISGID != 0) {
- if (expect_setgid)
- cl_assert((st.st_mode & S_ISGID) != 0);
- else
- cl_assert((st.st_mode & S_ISGID) == 0);
- }
+ if (S_ISGID != 0)
+ cl_assert_equal_b(expect_setgid, (st.st_mode & S_ISGID) != 0);
cl_assert_equal_b(
GIT_PERMS_EXECUTABLE(expect_mode), GIT_PERMS_EXECUTABLE(st.st_mode));