Sort branches by commit date like lazygit

Use git for-each-ref with --sort=-committerdate to order branches by
last commit date (newest first), matching lazygit's default behavior.
Added e2e test with controlled commit dates to verify ordering.

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2026-01-22 19:14:22 -05:00
parent 7c2e9b9abf
commit 52a1054757
4 changed files with 160 additions and 5 deletions
+5 -1
View File
@@ -12,4 +12,8 @@
e2e:setup {:doc "Setup standard e2e test repo"
:task (e2e/setup-test-repo)}
e2e:setup-cursor {:doc "Setup cursor navigation test repo"
:task (e2e/setup-cursor-test-repo)}}}
:task (e2e/setup-cursor-test-repo)}
e2e:setup-branch-order {:doc "Setup branch order test repo"
:task (e2e/setup-branch-order-test-repo)}
e2e:cleanup-branch-order {:doc "Cleanup branch order test repo"
:task (e2e/cleanup-branch-order-test-repo)}}}