Skip to content

Commit

Permalink
fix(changelog): set the correct previous tag when a custom tag is given
Browse files Browse the repository at this point in the history
  • Loading branch information
orhun committed Nov 25, 2023
1 parent b2f8091 commit 6203f77
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion git-cliff/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,11 @@ fn process_repository<'a>(

// Set the previous release if needed.
if args.latest || args.unreleased {
let sub = if args.latest { 2 } else { 1 };
let sub = if args.latest || args.tag.is_some() {
2
} else {
1
};
if let Some((commit_id, version)) =
tags.len().checked_sub(sub).and_then(|v| tags.get_index(v))
{
Expand Down

0 comments on commit 6203f77

Please sign in to comment.