File tree Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Expand file tree Collapse file tree 1 file changed +11
-10
lines changed Original file line number Diff line number Diff line change @@ -154,23 +154,24 @@ fn handle(
154
154
. ok_or_else ( || anyhow:: Error :: msg ( format ! ( "Remote URLs must have host names: {}" , url) ) ) ?,
155
155
)
156
156
. join ( to_relative ( git_url:: expand_path ( None , url. path . as_bstr ( ) ) ?) ) ;
157
+
158
+ if git_workdir. canonicalize ( ) ? == destination. canonicalize ( ) ? {
159
+ progress. info ( format ! (
160
+ "Skipping {:?} as it is in the correct spot" ,
161
+ git_workdir. display( )
162
+ ) ) ;
163
+ return Ok ( ( ) ) ;
164
+ }
157
165
match mode {
158
166
Mode :: Simulate => progress. info ( format ! (
159
167
"WOULD move {} to {}" ,
160
168
git_workdir. display( ) ,
161
169
destination. display( )
162
170
) ) ,
163
171
Mode :: Execute => {
164
- if git_workdir. canonicalize ( ) ? == destination {
165
- progress. info ( format ! (
166
- "Skipping {:?} as it is in the correct spot" ,
167
- git_workdir. display( )
168
- ) ) ;
169
- } else {
170
- std:: fs:: create_dir_all ( destination. parent ( ) . expect ( "repo destination is not the root" ) ) ?;
171
- progress. done ( format ! ( "Moving {} to {}" , git_workdir. display( ) , destination. display( ) ) ) ;
172
- std:: fs:: rename ( git_workdir, & destination) ?;
173
- }
172
+ std:: fs:: create_dir_all ( destination. parent ( ) . expect ( "repo destination is not the root" ) ) ?;
173
+ progress. done ( format ! ( "Moving {} to {}" , git_workdir. display( ) , destination. display( ) ) ) ;
174
+ std:: fs:: rename ( git_workdir, & destination) ?;
174
175
}
175
176
}
176
177
Ok ( ( ) )
You can’t perform that action at this time.
0 commit comments