Skip to content

Commit a492a5d

Browse files
committed
minor refactor
1 parent 903cb2d commit a492a5d

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

crates/gitbutler-project/src/project.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -126,10 +126,12 @@ impl Project {
126126
// nexted insided of another via a gitignored folder.
127127
// We want to match on the longest project path.
128128
projects.sort_by(|a, b| {
129-
b.path
130-
.to_string_lossy()
129+
a.path
130+
.as_os_str()
131131
.len()
132-
.cmp(&a.path.to_string_lossy().len())
132+
.cmp(&b.path.as_os_str().len())
133+
// longest first
134+
.reverse()
133135
});
134136
let resolved_path = if path.is_relative() {
135137
path.canonicalize().context("Failed to canonicalize path")?

0 commit comments

Comments
 (0)