Skip to content

Commit

Permalink
fix(args): override the sort related config if args are present (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
orhun committed Dec 3, 2021
1 parent 02a6187 commit ef63727
Showing 1 changed file with 8 additions and 4 deletions.
12 changes: 8 additions & 4 deletions git-cliff/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,11 +96,15 @@ pub fn run(mut args: Opt) -> Result<()> {
if let Some(template) = args.body {
config.changelog.body = template;
}
if let Some(sort_commits) = &config.git.sort_commits {
args.sort = sort_commits.to_string();
if args.sort == "oldest" {
if let Some(ref sort_commits) = config.git.sort_commits {
args.sort = sort_commits.to_string();
}
}
if let Some(topo_order) = config.git.topo_order {
args.topo_order = topo_order;
if !args.topo_order {
if let Some(topo_order) = config.git.topo_order {
args.topo_order = topo_order;
}
}

// Initialize the git repository.
Expand Down

0 comments on commit ef63727

Please sign in to comment.