File tree Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Expand file tree Collapse file tree 1 file changed +4
-5
lines changed Original file line number Diff line number Diff line change @@ -355,17 +355,16 @@ impl GitCheckout {
355
355
paths:: remove_dir_all ( into) ?;
356
356
}
357
357
358
- let url = Url :: from_file_path ( & database. repo . path ) . map_err ( |( ) | {
359
- anyhow:: format_err!( "Invalid path URL: {}" , database. repo. path. display( ) )
360
- } ) ?;
361
-
362
358
// Perform a local clone of the repository, which will attempt to use
363
359
// hardlinks to set up the repository. This should speed up the clone operation
364
360
// quite a bit if it works.
365
361
ProcessBuilder :: new ( "git" )
366
362
. arg ( "clone" )
367
363
. arg ( "--local" )
368
- . arg ( url. as_str ( ) )
364
+ // Make sure to pass the local file path and not a file://... url. If given a url,
365
+ // Git treats the repository as a remote origin and gets confused because we don't
366
+ // have a HEAD checked out.
367
+ . arg ( & database. repo . path )
369
368
. arg ( into)
370
369
. exec_with_streaming ( & mut silent, & mut silent, true ) ?;
371
370
You can’t perform that action at this time.
0 commit comments