summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2022-02-21 16:13:52 +0000
committerEdward Thomson <ethomson@edwardthomson.com>2022-02-21 16:13:52 +0000
commitf45121edd174bd2f87881f3b6fdad4232741a9ad (patch)
tree909044ad9f20460ea6ed046a304992098a89d8f0 /tests
parent83f2a20eb7727fcf418a17c75cb088ce2cc432ec (diff)
downloadlibgit2-f45121edd174bd2f87881f3b6fdad4232741a9ad.tar.gz
win32: `find_system_dirs` does not return `GIT_ENOTFOUND`
Allow for no Git for Windows installation. When there is no GfW found in the path or registry, `git_win32__find_system_dirs` would return a `GIT_ENOTFOUND`. Callers were not expecting this. Since this is no error, we simply return `0` so that callers can move on with their lives.
Diffstat (limited to 'tests')
-rw-r--r--tests/win32/systemdir.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/win32/systemdir.c b/tests/win32/systemdir.c
index 46fa06a50..52c1784a1 100644
--- a/tests/win32/systemdir.c
+++ b/tests/win32/systemdir.c
@@ -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
+}