1
1
mirror of https://github.com/orhun/git-cliff.git synced 2024-12-15 08:21:39 +03:00

fix(args): override the sort related config if args are present (#39)

This commit is contained in:
Orhun Parmaksız 2021-12-03 22:57:07 +03:00
parent 02a6187a58
commit ef63727b5f
No known key found for this signature in database
GPG Key ID: B928720AEC532117

View File

@ -96,11 +96,15 @@ pub fn run(mut args: Opt) -> Result<()> {
if let Some(template) = args.body { if let Some(template) = args.body {
config.changelog.body = template; config.changelog.body = template;
} }
if let Some(sort_commits) = &config.git.sort_commits { if args.sort == "oldest" {
args.sort = sort_commits.to_string(); 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 { if !args.topo_order {
args.topo_order = topo_order; if let Some(topo_order) = config.git.topo_order {
args.topo_order = topo_order;
}
} }
// Initialize the git repository. // Initialize the git repository.