diff options
author | Edward Thomson <ethomson@github.com> | 2016-05-26 10:25:40 -0500 |
---|---|---|
committer | Edward Thomson <ethomson@github.com> | 2016-05-26 10:25:40 -0500 |
commit | e102daa4f62ddac22765cfaaff4712624060956e (patch) | |
tree | f3431f69ba36538a6c52616c9abcca1467f7e1ab | |
parent | 06f42b62173f92c9ee74653268af53e81270d0af (diff) | |
parent | 407f2e9fbda241a946542800584e73c20d487110 (diff) | |
download | libgit2-e102daa4f62ddac22765cfaaff4712624060956e.tar.gz |
Merge pull request #3798 from mmuman/stat-test-fix
test: Fix stat() test to mask out unwanted bits
-rw-r--r-- | tests/checkout/index.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/tests/checkout/index.c b/tests/checkout/index.c index 8af3e5684..ca63dc3f8 100644 --- a/tests/checkout/index.c +++ b/tests/checkout/index.c @@ -294,11 +294,12 @@ void test_checkout_index__options_dir_modes(void) (void)p_umask(um = p_umask(022)); cl_git_pass(p_stat("./testrepo/a", &st)); - cl_assert_equal_i_fmt(st.st_mode, (GIT_FILEMODE_TREE | 0701) & ~um, "%07o"); + /* Haiku & Hurd use other mode bits, so we must mask them out */ + cl_assert_equal_i_fmt(st.st_mode & (S_IFMT | 07777), (GIT_FILEMODE_TREE | 0701) & ~um, "%07o"); /* File-mode test, since we're on the 'dir' branch */ cl_git_pass(p_stat("./testrepo/a/b.txt", &st)); - cl_assert_equal_i_fmt(st.st_mode, GIT_FILEMODE_BLOB_EXECUTABLE & ~um, "%07o"); + cl_assert_equal_i_fmt(st.st_mode & (S_IFMT | 07777), GIT_FILEMODE_BLOB_EXECUTABLE & ~um, "%07o"); git_commit_free(commit); } |