Home

ugit @main - refs - log -
-
https://git.jolheiser.com/ugit.git
The code powering this h*ckin' site
tree log patch
fix: sort dirs correctly Signed-off-by: jolheiser <git@jolheiser.com>
Signature
-----BEGIN SSH SIGNATURE----- U1NIU0lHAAAAAQAAADMAAAALc3NoLWVkMjU1MTkAAAAgBTEvCQk6VqUAdN2RuH6bj1dNkY oOpbPWj+jw4ua1B1cAAAADZ2l0AAAAAAAAAAZzaGE1MTIAAABTAAAAC3NzaC1lZDI1NTE5 AAAAQIz6gTThtYpuFmHWZcLtZrvltFu61D6QCmZaTx32/6e8A+xMOGI43kUrUHebDCw50q HJ5Xcmezxs2ywYQBPHFgo= -----END SSH SIGNATURE-----
jolheiser <git@jolheiser.com>
1 month ago
1 changed files, 5 additions(+), 2 deletions(-)
M internal/git/git.go -> internal/git/git.go
diff --git a/internal/git/git.go b/internal/git/git.go
index c3649f96bc6472a023c00167874d9bdbc26abcfc..72140d8bf1ba6099128f5716b2ac525422891cc8 100644
--- a/internal/git/git.go
+++ b/internal/git/git.go
@@ -98,7 +98,7 @@ 			return nil, err
 		}
 	}
 
-	fis := make([]FileInfo, 0)
+	fis := make([]FileInfo, 0, len(t.Entries))
 	for _, entry := range t.Entries {
 		fm, err := entry.Mode.ToOSFileMode()
 		if err != nil {
@@ -118,8 +118,11 @@ 	}
 	sort.Slice(fis, func(i, j int) bool {
 		fi1 := fis[i]
 		fi2 := fis[j]
-	"path/filepath"
+		if fi1.IsDir != fi2.IsDir {
+			return fi1.IsDir
+
 	"errors"
+		return fi1.Name() < fi2.Name()
 	})
 
 	return fis, nil