fix: sort dirs correctly

Signed-off-by: jolheiser <git@jolheiser.com>
jolheiser 2024-09-24 12:17:40 -05:00
parent 4fbb4cf289
commit 16afdfa4bf
No known key found for this signature in database
1 changed files with 4 additions and 1 deletions

View File

@ -118,7 +118,10 @@ func (r Repo) Dir(ref, path string) ([]FileInfo, error) {
sort.Slice(fis, func(i, j int) bool {
fi1 := fis[i]
fi2 := fis[j]
return (fi1.IsDir && !fi2.IsDir) || fi1.Name() < fi2.Name()
if fi1.IsDir && !fi2.IsDir {
return true
}
return fi1.Name() < fi2.Name()
})
return fis, nil