@@ -605,6 +605,45 @@ void test_status_worktree__filemode_changes(void)
605605 cl_assert_equal_i (0 , counts .wrong_sorted_path );
606606}
607607
608+ void test_status_worktree__filemode_non755 (void )
609+ {
610+ git_repository * repo = cl_git_sandbox_init ("filemodes" );
611+ status_entry_counts counts ;
612+ git_status_options opts = GIT_STATUS_OPTIONS_INIT ;
613+ git_buf executable_path = GIT_BUF_INIT ;
614+ git_buf nonexecutable_path = GIT_BUF_INIT ;
615+
616+ if (!cl_is_chmod_supported ())
617+ return ;
618+
619+ opts .flags = GIT_STATUS_OPT_INCLUDE_UNTRACKED |
620+ GIT_STATUS_OPT_INCLUDE_IGNORED |
621+ GIT_STATUS_OPT_INCLUDE_UNMODIFIED ;
622+
623+ git_buf_joinpath (& executable_path , git_repository_workdir (repo ), "exec_on" );
624+ cl_must_pass (p_chmod (git_buf_cstr (& executable_path ), 0744 ));
625+ git_buf_dispose (& executable_path );
626+
627+ git_buf_joinpath (& nonexecutable_path , git_repository_workdir (repo ), "exec_off" );
628+
629+ cl_must_pass (p_chmod (git_buf_cstr (& nonexecutable_path ), 0655 ));
630+ git_buf_dispose (& nonexecutable_path );
631+
632+ memset (& counts , 0 , sizeof (counts ));
633+ counts .expected_entry_count = filemode_count ;
634+ counts .expected_paths = filemode_paths ;
635+ counts .expected_statuses = filemode_statuses ;
636+
637+ cl_git_pass (
638+ git_status_foreach_ext (repo , & opts , cb_status__normal , & counts )
639+ );
640+
641+ cl_assert_equal_i (counts .expected_entry_count , counts .entry_count );
642+ cl_assert_equal_i (0 , counts .wrong_status_flags_count );
643+ cl_assert_equal_i (0 , counts .wrong_sorted_path );
644+ }
645+
646+
608647static int cb_status__interrupt (const char * p , unsigned int s , void * payload )
609648{
610649 volatile int * count = (int * )payload ;
0 commit comments