Sort repository tree entries in natural way (#2506)

* Sort repository tree entries in natural way

* Fix sort for different length strings with first parts equal

* Improve test case

* Refactor return statements

* Update gitea/git dependency
This commit is contained in:
Lauris BH 2017-09-19 11:37:03 +03:00 committed by GitHub
parent 4cb9394a97
commit 23645fe05f
5 changed files with 145 additions and 16 deletions

View file

@ -47,7 +47,7 @@ func renderDirectory(ctx *context.Context, treeLink string) {
ctx.Handle(500, "ListEntries", err)
return
}
entries.Sort()
entries.CustomSort(base.NaturalSortLess)
ctx.Data["Files"], err = entries.GetCommitsInfo(ctx.Repo.Commit, ctx.Repo.TreePath)
if err != nil {