@@ -489,6 +489,13 @@ void test_repo_open__validates_dir_ownership(void)
489489 git_fs_path__set_owner (GIT_FS_PATH_OWNER_ADMINISTRATOR );
490490 cl_git_fail (git_repository_open (& repo , "empty_standard_repo" ));
491491
492+ #ifdef GIT_WIN32
493+ /* When the user is an administrator, succeed on Windows. */
494+ git_fs_path__set_owner (GIT_FS_PATH_USER_IS_ADMINISTRATOR );
495+ cl_git_pass (git_repository_open (& repo , "empty_standard_repo" ));
496+ git_repository_free (repo );
497+ #endif
498+
492499 /* When an unknown user owns the repo config, fail */
493500 git_fs_path__set_owner (GIT_FS_PATH_OWNER_OTHER );
494501 cl_git_fail (git_repository_open (& repo , "empty_standard_repo" ));
@@ -511,6 +518,13 @@ void test_repo_open__validates_bare_repo_ownership(void)
511518 git_fs_path__set_owner (GIT_FS_PATH_OWNER_ADMINISTRATOR );
512519 cl_git_fail (git_repository_open (& repo , "testrepo.git" ));
513520
521+ #ifdef GIT_WIN32
522+ /* When the user is an administrator, succeed on Windows. */
523+ git_fs_path__set_owner (GIT_FS_PATH_USER_IS_ADMINISTRATOR );
524+ cl_git_pass (git_repository_open (& repo , "testrepo.git" ));
525+ git_repository_free (repo );
526+ #endif
527+
514528 /* When an unknown user owns the repo config, fail */
515529 git_fs_path__set_owner (GIT_FS_PATH_OWNER_OTHER );
516530 cl_git_fail (git_repository_open (& repo , "testrepo.git" ));
0 commit comments