MCPcopy Create free account
hub / github.com/go-git/go-git / Less

Method Less

plumbing/object/tree.go:281–291  ·  view source on GitHub ↗
(i, j int)

Source from the content-addressed store, hash-verified

279}
280
281func (s TreeEntrySorter) Less(i, j int) bool {
282 name1 := s[i].Name
283 name2 := s[j].Name
284 if s[i].Mode == filemode.Dir {
285 name1 += "/"
286 }
287 if s[j].Mode == filemode.Dir {
288 name2 += "/"
289 }
290 return name1 < name2
291}
292
293func (s TreeEntrySorter) Swap(i, j int) {
294 s[i], s[j] = s[j], s[i]

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected