mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-22 22:20:02 +00:00
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.
This commit is contained in:
parent
9e8d75c7d4
commit
3428a52359
@ -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);
|
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
|
||||||
|
}
|
||||||
|
0
tests/resources/testrepo.git/index
Normal file → Executable file
0
tests/resources/testrepo.git/index
Normal file → Executable file
Loading…
Reference in New Issue
Block a user