|
1 | 1 | use clap::{App, Arg, ArgMatches, ValueHint};
|
2 | 2 | use git2::{DiffOptions, Repository};
|
3 | 3 |
|
4 |
| -use crate::commitdata::CommitData; |
5 |
| -use crate::error::Error; |
6 |
| -use crate::patchdescription::PatchDescription; |
7 |
| -use crate::signature::CheckedSignature; |
8 |
| -use crate::transaction::{ConflictMode, StackTransaction}; |
9 |
| -use crate::{argset, patchname::PatchName, stack::Stack}; |
| 4 | +use crate::{ |
| 5 | + argset, |
| 6 | + commitdata::CommitData, |
| 7 | + error::Error, |
| 8 | + patchdescription::PatchDescription, |
| 9 | + patchname::PatchName, |
| 10 | + signature::CheckedSignature, |
| 11 | + stack::{ConflictMode, Stack, StackTransaction}, |
| 12 | +}; |
10 | 13 |
|
11 | 14 | pub(crate) fn get_subcommand() -> App<'static> {
|
12 | 15 | App::new("new")
|
@@ -76,13 +79,14 @@ pub(crate) fn run(matches: &ArgMatches) -> super::Result {
|
76 | 79 | let tree = head_ref.peel_to_tree()?;
|
77 | 80 | let parents = vec![head_ref.peel_to_commit()?];
|
78 | 81 |
|
79 |
| - let (message, must_edit) = if let Some(message) = crate::message::get_message_from_args(matches)? { |
80 |
| - (message, false) |
81 |
| - } else if let Some(message_template) = crate::message::get_message_template(&repo)? { |
82 |
| - (message_template, true) |
83 |
| - } else { |
84 |
| - (String::new(), true) |
85 |
| - }; |
| 82 | + let (message, must_edit) = |
| 83 | + if let Some(message) = crate::message::get_message_from_args(matches)? { |
| 84 | + (message, false) |
| 85 | + } else if let Some(message_template) = crate::message::get_message_template(&repo)? { |
| 86 | + (message_template, true) |
| 87 | + } else { |
| 88 | + (String::new(), true) |
| 89 | + }; |
86 | 90 |
|
87 | 91 | let committer = CheckedSignature::default_committer(Some(&config))?;
|
88 | 92 | let message = crate::trailers::add_trailers(message, matches, &committer)?;
|
|
0 commit comments