summaryrefslogtreecommitdiff
path: root/tests-clar/index/addall.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests-clar/index/addall.c')
-rw-r--r--tests-clar/index/addall.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/tests-clar/index/addall.c b/tests-clar/index/addall.c
index fca6e77fa..e6ce463a3 100644
--- a/tests-clar/index/addall.c
+++ b/tests-clar/index/addall.c
@@ -1,6 +1,7 @@
#include "clar_libgit2.h"
#include "../status/status_helpers.h"
#include "posix.h"
+#include "fileops.h"
git_repository *g_repo = NULL;
@@ -108,8 +109,10 @@ static void check_stat_data(git_index *index, const char *path, bool match)
cl_assert(st.st_size == entry->file_size);
cl_assert(st.st_uid == entry->uid);
cl_assert(st.st_gid == entry->gid);
- cl_assert_equal_b(st.st_mode & ~0777, entry->mode & ~0777);
- cl_assert_equal_b(st.st_mode & 0111, entry->mode & 0111);
+ cl_assert_equal_i_fmt(
+ GIT_MODE_TYPE(st.st_mode), GIT_MODE_TYPE(entry->mode), "%07o");
+ cl_assert_equal_b(
+ GIT_PERMS_EXECUTABLE(st.st_mode), GIT_PERMS_EXECUTABLE(entry->mode));
} else {
/* most things will still match */
cl_assert(st.st_size != entry->file_size);