test: add scope and set scope to be local in all tests

This commit is contained in:
Slug-Boi
2025-04-17 23:13:44 +02:00
committed by Theis
parent b608a52aa6
commit c7a9d3429d
2 changed files with 14 additions and 11 deletions
+5 -2
View File
@@ -387,7 +387,7 @@ func (m Model) View() string {
const title_text = "Select authors to add to commit \t|\t"
func listModel() Model {
func listModel(scope ...int) Model {
selected = map[string]item{}
@@ -396,7 +396,10 @@ func listModel() Model {
listKeys := newListKeyMap()
// Add items to the list
items := generate_list(git_scope)
if len(scope) == 0 {
scope = append(scope, git_scope)
}
items := generate_list(scope[0])
sort.Slice(items, func(i, j int) bool {
return items[i].(item) < items[j].(item)