Skip to content

Commit

Permalink
print out message (#100)
Browse files Browse the repository at this point in the history
  • Loading branch information
JunNishimura committed Jun 7, 2023
1 parent ecd5fce commit 6f81b7a
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions internal/store/refs.go
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ func (r *Refs) DeleteBranch(rootGoitPath, headBranchName, deleteBranchName strin
if n == NewBranchFlag {
return fmt.Errorf("branch '%s' not found", deleteBranchName)
}
deleteBranch := r.Heads[n]

// delete from refs
r.Heads = append(r.Heads[:n], r.Heads[n+1:]...)
Expand All @@ -187,5 +188,8 @@ func (r *Refs) DeleteBranch(rootGoitPath, headBranchName, deleteBranchName strin
return fmt.Errorf("fail to delete branch file: %w", err)
}

// print out message
fmt.Printf("Deleted branch %s (was %s).\n", deleteBranch.Name, deleteBranch.hash.String()[:7])

return nil
}

0 comments on commit 6f81b7a

Please sign in to comment.