@@ -55,6 +55,12 @@ pub(crate) mod function {
55
55
let ( mut checkout, fetch_outcome) =
56
56
prepare. fetch_then_checkout ( & mut progress, & git:: interrupt:: IS_INTERRUPTED ) ?;
57
57
58
+ let repo = if bare {
59
+ checkout. persist ( )
60
+ } else {
61
+ checkout. main_worktree ( progress, & git:: interrupt:: IS_INTERRUPTED ) ?
62
+ } ;
63
+
58
64
if handshake_info {
59
65
writeln ! ( out, "Handshake Information" ) ?;
60
66
writeln ! ( out, "\t {:?}" , fetch_outcome. ref_map. handshake) ?;
@@ -65,43 +71,14 @@ pub(crate) mod function {
65
71
unreachable ! ( "clone always has changes" )
66
72
}
67
73
Status :: DryRun { .. } => unreachable ! ( "dry-run unsupported" ) ,
68
- Status :: Change {
69
- update_refs,
70
- write_pack_bundle,
71
- } => {
72
- let repo = checkout. repo ( ) ;
74
+ Status :: Change { update_refs, .. } => {
73
75
let remote = repo
74
76
. find_default_remote ( git:: remote:: Direction :: Fetch )
75
77
. expect ( "one origin remote" ) ?;
76
78
let ref_specs = remote. refspecs ( git:: remote:: Direction :: Fetch ) ;
77
- print_updates (
78
- checkout. repo ( ) ,
79
- update_refs,
80
- ref_specs,
81
- fetch_outcome. ref_map ,
82
- & mut out,
83
- err,
84
- ) ?;
85
- if let Some ( data_path) = write_pack_bundle. data_path {
86
- writeln ! ( out, "pack file: \" {}\" " , data_path. display( ) ) . ok ( ) ;
87
- }
88
- if let Some ( index_path) = write_pack_bundle. index_path {
89
- writeln ! ( out, "index file: \" {}\" " , index_path. display( ) ) . ok ( ) ;
90
- }
79
+ print_updates ( & repo, update_refs, ref_specs, fetch_outcome. ref_map , & mut out, err) ?;
91
80
}
92
81
} ;
93
-
94
- let repo = if bare {
95
- checkout. persist ( )
96
- } else {
97
- checkout. main_worktree ( progress, & git:: interrupt:: IS_INTERRUPTED ) ?
98
- } ;
99
- writeln ! (
100
- out,
101
- "clone (bare = {}) successful at \" {}\" " ,
102
- bare,
103
- repo. work_dir( ) . unwrap_or_else( || repo. git_dir( ) ) . display( )
104
- ) ?;
105
82
Ok ( ( ) )
106
83
}
107
84
}
0 commit comments