File tree Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Expand file tree Collapse file tree 1 file changed +4
-4
lines changed Original file line number Diff line number Diff line change @@ -187,7 +187,7 @@ impl GitDatabase {
187
187
// clone is created.
188
188
let checkout = match git2:: Repository :: open ( dest)
189
189
. ok ( )
190
- . map ( |repo| GitCheckout :: new ( dest , self , rev, repo) )
190
+ . map ( |repo| GitCheckout :: new ( self , rev, repo) )
191
191
. filter ( |co| co. is_fresh ( ) )
192
192
{
193
193
Some ( co) => co,
@@ -265,13 +265,13 @@ impl<'a> GitCheckout<'a> {
265
265
/// is done. Use [`GitCheckout::is_fresh`] to check.
266
266
///
267
267
/// * The `database` is where this checkout is from.
268
- /// * The `repo` will be the checked out Git repoistory at `path` .
268
+ /// * The `repo` will be the checked out Git repoistory.
269
269
fn new (
270
- path : & Path ,
271
270
database : & ' a GitDatabase ,
272
271
revision : git2:: Oid ,
273
272
repo : git2:: Repository ,
274
273
) -> GitCheckout < ' a > {
274
+ let path = repo. workdir ( ) . unwrap_or_else ( || repo. path ( ) ) ;
275
275
GitCheckout {
276
276
path : path. to_path_buf ( ) ,
277
277
database,
@@ -335,7 +335,7 @@ impl<'a> GitCheckout<'a> {
335
335
} ) ?;
336
336
let repo = repo. unwrap ( ) ;
337
337
338
- let checkout = GitCheckout :: new ( into , database, revision, repo) ;
338
+ let checkout = GitCheckout :: new ( database, revision, repo) ;
339
339
checkout. reset ( config) ?;
340
340
Ok ( checkout)
341
341
}
You can’t perform that action at this time.
0 commit comments