cli: rephrase diff summary header so it can be reused for commit/describe

This commit is contained in:
Yuya Nishihara 2022-12-23 00:07:13 +09:00
parent e7d9e1ff9c
commit d438f43224
2 changed files with 3 additions and 3 deletions

View file

@ -2478,7 +2478,7 @@ fn description_template_for_cmd_split(
// Double-check this assumption for diffs that include file content.
);
Ok(format!("JJ: {intro}\n{overall_commit_description}\n")
+ "JJ: This part contains the following changes:\n"
+ "JJ: This commit contains the following changes:\n"
+ &textwrap::indent(diff_summary, "JJ: "))
}

View file

@ -48,7 +48,7 @@ fn test_split_by_paths() {
std::fs::read_to_string(test_env.env_root().join("editor0")).unwrap(), @r###"
JJ: Enter commit description for the first part (parent).
JJ: This part contains the following changes:
JJ: This commit contains the following changes:
JJ: A file2
JJ: Lines starting with "JJ: " (like this one) will be removed.
@ -57,7 +57,7 @@ fn test_split_by_paths() {
std::fs::read_to_string(test_env.env_root().join("editor1")).unwrap(), @r###"
JJ: Enter commit description for the second part (child).
JJ: This part contains the following changes:
JJ: This commit contains the following changes:
JJ: A file1
JJ: A file3