Skip to content

Commit dd835ff

Browse files
committed
fix: make clean command works (do nothing) when branch list to delete is empty. (#7)
1 parent 7a473f7 commit dd835ff

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

internal/git/cli_actor.go

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,10 @@ func (g *cliActor) FetchAll(ctx context.Context) error {
2323
}
2424

2525
func (g *cliActor) DeleteBranches(ctx context.Context, branches []Branch) error {
26+
if len(branches) == 0 {
27+
return nil
28+
}
29+
2630
args := []string{"branch", "-d"}
2731
for _, branch := range branches {
2832
args = append(args, branch.Name)

0 commit comments

Comments
 (0)