From 45e3d652a3dd0cbb791f0776ccbdee669395a2c5 Mon Sep 17 00:00:00 2001 From: Gabe Cook Date: Tue, 12 Mar 2024 01:56:06 -0500 Subject: [PATCH] fix: Fix empty changelog when HEAD is a tag --- cmd/cmd.go | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/cmd/cmd.go b/cmd/cmd.go index bd17beb..b9bfa93 100644 --- a/cmd/cmd.go +++ b/cmd/cmd.go @@ -46,9 +46,11 @@ func run(cmd *cobra.Command, args []string) error { return err } + var latest *plumbing.Reference var previous *plumbing.Reference if err := tags.ForEach(func(reference *plumbing.Reference) error { - previous = reference + previous = latest + latest = reference return nil }); err != nil && !errors.Is(err, io.EOF) { return err