mirror of
https://github.com/kopia/kopia.git
synced 2026-10-22 22:24:49 -04:00
fixed sorting of synthetic fs.Entries
This commit is contained in:
1 parent
ebe00e9405
commit
e01fcff9a4
4 files changed
+11
No files matched your search
@@ -55,6 +55,13 @@ func (e Entries) FindByName(n string) Entry {
|
||||
return nil
|
||||
}
|
||||
|
||||
// Sort sorts the entries by name.
|
||||
func (e Entries) Sort() {
|
||||
sort.Slice(e, func(i, j int) bool {
|
||||
return e[i].Metadata().Name < e[j].Metadata().Name
|
||||
})
|
||||
}
|
||||
|
||||
// EntryPath returns a path of a given entry from its root node.
|
||||
func EntryPath(e Entry) string {
|
||||
var parts []string
|
||||
|
||||
@@ -48,6 +48,7 @@ func (s *repositoryAllSources) Readdir() (fs.Entries, error) {
|
||||
})
|
||||
}
|
||||
|
||||
result.Sort()
|
||||
return result, nil
|
||||
}
|
||||
|
||||
|
||||
@@ -44,5 +44,7 @@ func (s *sourceDirectories) Readdir() (fs.Entries, error) {
|
||||
result = append(result, &sourceSnapshots{s, s.repo, s.snapshotManager, src})
|
||||
}
|
||||
|
||||
result.Sort()
|
||||
|
||||
return result, nil
|
||||
}
|
||||
@@ -59,6 +59,7 @@ func (s *sourceSnapshots) Readdir() (fs.Entries, error) {
|
||||
|
||||
result = append(result, e)
|
||||
}
|
||||
result.Sort()
|
||||
|
||||
return result, nil
|
||||
}
|
||||
Reference in new issue
Block a user