File tree Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Expand file tree Collapse file tree 2 files changed +26
-0
lines changed Original file line number Diff line number Diff line change @@ -2630,6 +2630,8 @@ static int repo_init_directories(
2630
2630
if (git_str_joinpath (repo_path , given_repo , add_dotgit ? GIT_DIR : "" ) < 0 )
2631
2631
return -1 ;
2632
2632
2633
+ git_fs_path_mkposix (repo_path -> ptr );
2634
+
2633
2635
has_dotgit = (git__suffixcmp (repo_path -> ptr , "/" GIT_DIR ) == 0 );
2634
2636
if (has_dotgit )
2635
2637
opts -> flags |= GIT_REPOSITORY_INIT__HAS_DOTGIT ;
Original file line number Diff line number Diff line change @@ -755,3 +755,27 @@ void test_repo_init__longpath(void)
755
755
git_str_dispose (& path );
756
756
#endif
757
757
}
758
+
759
+ void test_repo_init__absolute_path_with_backslashes (void )
760
+ {
761
+ #ifdef GIT_WIN32
762
+ git_repository_init_options initopts = GIT_REPOSITORY_INIT_OPTIONS_INIT ;
763
+ git_str path = GIT_STR_INIT ;
764
+ char * c ;
765
+
766
+ cl_set_cleanup (& cleanup_repository , "path" );
767
+
768
+ cl_git_pass (git_str_joinpath (& path , clar_sandbox_path (), "path/to/newrepo" ));
769
+
770
+ for (c = path .ptr ; * c ; c ++ ) {
771
+ if (* c == '/' )
772
+ * c = '\\' ;
773
+ }
774
+
775
+ initopts .flags |= GIT_REPOSITORY_INIT_MKDIR | GIT_REPOSITORY_INIT_MKPATH ;
776
+
777
+ cl_git_pass (git_repository_init_ext (& g_repo , path .ptr , & initopts ));
778
+ #else
779
+ clar__skip ();
780
+ #endif
781
+ }
You can’t perform that action at this time.
0 commit comments