cli: get author timestamp of description template in consistent way

There's a subtle difference. If the original commit was discardable, its author
timestamp is updated by CommitBuilder.
This commit is contained in:
Yuya Nishihara 2024-09-22 23:33:05 +09:00
parent 49e5585130
commit 05b90390ae
2 changed files with 2 additions and 2 deletions

View file

@ -155,7 +155,7 @@ pub(crate) fn cmd_describe(
let new_author = Signature {
name,
email,
timestamp: commit.author().timestamp,
timestamp: commit_builder.author().timestamp,
};
commit_builder.set_author(new_author);
}

View file

@ -568,7 +568,7 @@ fn test_describe_author() {
insta::assert_snapshot!(
std::fs::read_to_string(test_env.env_root().join("editor")).unwrap(), @r#"
JJ: Author: Super Seeder <super.seeder@example.com> (2001-02-03 08:05:10)
JJ: Author: Super Seeder <super.seeder@example.com> (2001-02-03 08:05:12)
JJ: Committer: Test User <test.user@example.com> (2001-02-03 08:05:12)
JJ: 0 files changed, 0 insertions(+), 0 deletions(-)