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

Method sortName

worktree_commit.go:233–238  ·  view source on GitHub ↗
(te object.TreeEntry)

Source from the content-addressed store, hash-verified

231type sortableEntries []object.TreeEntry
232
233func (sortableEntries) sortName(te object.TreeEntry) string {
234 if te.Mode == filemode.Dir {
235 return te.Name + "/"
236 }
237 return te.Name
238}
239func (se sortableEntries) Len() int { return len(se) }
240func (se sortableEntries) Less(i int, j int) bool { return se.sortName(se[i]) < se.sortName(se[j]) }
241func (se sortableEntries) Swap(i int, j int) { se[i], se[j] = se[j], se[i] }

Callers 1

LessMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected