Skip to content

win32: find_system_dirs does not return GIT_ENOTFOUND #6228

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Feb 22, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion src/win32/findfile.c
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ int git_win32__find_system_dirs(git_str *out, const char *subdir)
has_regdir = (find_sysdir_in_registry(regdir) == 0);

if (!has_pathdir && !has_regdir)
return GIT_ENOTFOUND;
return 0;

/*
* Usually the git in the path is the same git in the registry,
Expand Down
10 changes: 10 additions & 0 deletions tests/win32/systemdir.c
Original file line number Diff line number Diff line change
Expand Up @@ -326,3 +326,13 @@ void test_win32_systemdir__prefers_path_to_registry(void)
git_config_free(cfg);
#endif
}

void test_win32_systemdir__no_git_installed(void)
{
#ifdef GIT_WIN32
git_str out = GIT_STR_INIT;

cl_git_pass(git_win32__find_system_dirs(&out, "etc"));
cl_assert_equal_s(out.ptr, "");
#endif
}