Commit 3428a523 by Patrick Steinhardt

tests: repo: assert discovery starting at Win32 roots finishes

As of recently, we failed to correctly discover repositories at a
Win32 system root. Instead of aborting the upwards-traversal of
the file system, we were looping infinitely when traversal
started at either a Win32 drive prefix ("C:/") or a network path
("//somehost").

The issue has been fixed, so add a test to catch regressions.
parent 9e8d75c7
......@@ -199,3 +199,12 @@ void test_repo_discover__discovery_starting_at_file_succeeds(void)
ensure_repository_discover(SUB_REPOSITORY_FOLDER "/file", ceiling_dirs.ptr, SUB_REPOSITORY_GITDIR);
}
void test_repo_discover__discovery_starting_at_system_root_causes_no_hang(void)
{
#ifdef GIT_WIN32
git_buf out = GIT_BUF_INIT;
cl_git_fail(git_repository_discover(&out, "C:/", 0, NULL));
cl_git_fail(git_repository_discover(&out, "//localhost/", 0, NULL));
#endif
}
File mode changed from 100644 to 100755
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment