From a61f91b8cf22e7c0c2d7b413c80b3decbae1772f Mon Sep 17 00:00:00 2001 From: Yuya Nishihara Date: Tue, 14 May 2024 09:29:33 +0900 Subject: [PATCH] templater: propagate error from commit.parents() method --- cli/src/commit_templater.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/cli/src/commit_templater.rs b/cli/src/commit_templater.rs index cec7c9a24..ab6261920 100644 --- a/cli/src/commit_templater.rs +++ b/cli/src/commit_templater.rs @@ -463,7 +463,8 @@ fn builtin_commit_methods<'repo>() -> CommitTemplateBuildMethodFnMap<'repo, Comm "parents", |_language, _build_ctx, self_property, function| { template_parser::expect_no_arguments(function)?; - let out_property = self_property.map(|commit| commit.parents().try_collect().unwrap()); + let out_property = + self_property.and_then(|commit| Ok(commit.parents().try_collect()?)); Ok(L::wrap_commit_list(out_property)) }, );