File tree Expand file tree Collapse file tree 2 files changed +16
-2
lines changed
Expand file tree Collapse file tree 2 files changed +16
-2
lines changed Original file line number Diff line number Diff line change @@ -1174,9 +1174,12 @@ int git_config__find_programdata(git_str *path)
11741174 GIT_FS_PATH_OWNER_CURRENT_USER |
11751175 GIT_FS_PATH_OWNER_ADMINISTRATOR ;
11761176 bool is_safe ;
1177+ int error ;
1178+
1179+ if ((error = git_sysdir_find_programdata_file (path , GIT_CONFIG_FILENAME_PROGRAMDATA )) < 0 )
1180+ return error ;
11771181
1178- if (git_sysdir_find_programdata_file (path , GIT_CONFIG_FILENAME_PROGRAMDATA ) < 0 ||
1179- git_fs_path_owner_is (& is_safe , path -> ptr , owner_level ) < 0 )
1182+ if (git_fs_path_owner_is (& is_safe , path -> ptr , owner_level ) < 0 )
11801183 return -1 ;
11811184
11821185 if (!is_safe ) {
Original file line number Diff line number Diff line change 1+ #include "clar_libgit2.h"
2+
3+ void test_config_find__one (void )
4+ {
5+ git_buf buf = GIT_BUF_INIT ;
6+
7+ cl_git_fail_with (GIT_ENOTFOUND , git_config_find_global (& buf ));
8+ cl_git_fail_with (GIT_ENOTFOUND , git_config_find_xdg (& buf ));
9+ cl_git_fail_with (GIT_ENOTFOUND , git_config_find_system (& buf ));
10+ cl_git_fail_with (GIT_ENOTFOUND , git_config_find_programdata (& buf ));
11+ }
You can’t perform that action at this time.
0 commit comments