Skip to content

Commit c81c660

Browse files
committed
Merge branch 'cli-deduplicate-branches' into 'master'
fix: deduplicate branches in the CLI list command See merge request postgres-ai/database-lab!1065
2 parents 3a9a11c + 1f68841 commit c81c660

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)