mirror of https://git.jolheiser.com/ugit.git
fix: sort dirs correctly
Signed-off-by: jolheiser <git@jolheiser.com>
parent
4fbb4cf289
commit
16afdfa4bf
|
@ -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
|
||||
|
|
Loading…
Reference in New Issue