Skip to content

Commit 532ff2b

Browse files
committed
Fix journey tests by not allowing canonicalization of possibly…
…nonexisting destination dir to fail.
1 parent 47c7fb3 commit 532ff2b

File tree

1 file changed

+8
-6
lines changed

1 file changed

+8
-6
lines changed

gitoxide-core/src/organize.rs

Lines changed: 8 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -155,12 +155,14 @@ fn handle(
155155
)
156156
.join(to_relative(git_url::expand_path(None, url.path.as_bstr())?));
157157

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(());
158+
if let Ok(destination) = destination.canonicalize() {
159+
if git_workdir.canonicalize()? == destination {
160+
progress.info(format!(
161+
"Skipping {:?} as it is in the correct spot",
162+
git_workdir.display()
163+
));
164+
return Ok(());
165+
}
164166
}
165167
match mode {
166168
Mode::Simulate => progress.info(format!(

0 commit comments

Comments
 (0)