Skip to content

Commit 1f68841

Browse files
committed
fix: deduplicate branches in the CLI list command
1 parent a9448e7 commit 1f68841

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

engine/pkg/client/dblabapi/branch.go

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,7 @@ import (
1010
"encoding/json"
1111
"fmt"
1212
"net/http"
13+
"slices"
1314
"sort"
1415

1516
"gitlab.com/postgres-ai/database-lab/v3/pkg/client/dblabapi/types"
@@ -44,6 +45,7 @@ func (c *Client) ListBranches(ctx context.Context) ([]string, error) {
4445
listBranches = append(listBranches, branchView.Name)
4546
}
4647

48+
listBranches = slices.Compact(listBranches)
4749
sort.Strings(listBranches)
4850

4951
return listBranches, nil

0 commit comments

Comments
 (0)