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)
1174
1174
GIT_FS_PATH_OWNER_CURRENT_USER |
1175
1175
GIT_FS_PATH_OWNER_ADMINISTRATOR ;
1176
1176
bool is_safe ;
1177
+ int error ;
1178
+
1179
+ if ((error = git_sysdir_find_programdata_file (path , GIT_CONFIG_FILENAME_PROGRAMDATA )) < 0 )
1180
+ return error ;
1177
1181
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 )
1180
1183
return -1 ;
1181
1184
1182
1185
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