File tree Expand file tree Collapse file tree 1 file changed +6
-8
lines changed
Expand file tree Collapse file tree 1 file changed +6
-8
lines changed Original file line number Diff line number Diff line change @@ -131,6 +131,12 @@ impl Component for CommitComponent {
131131 self . input
132132 . set_title ( strings:: commit_title ( & self . key_config ) ) ;
133133
134+ self . commit_template =
135+ get_config_string ( CWD , "commit.template" )
136+ . ok ( )
137+ . flatten ( )
138+ . and_then ( |path| read_to_string ( path) . ok ( ) ) ;
139+
134140 if self . is_empty ( ) {
135141 if let Some ( s) = & self . commit_template {
136142 self . input . set_text ( s. clone ( ) ) ;
@@ -170,14 +176,6 @@ impl CommitComponent {
170176 pub fn update ( & mut self ) -> Result < ( ) > {
171177 self . git_branch_name . lookup ( ) . map ( Some ) . unwrap_or ( None ) ;
172178
173- self . commit_template . get_or_insert_with ( || {
174- get_config_string ( CWD , "commit.template" )
175- . ok ( )
176- . unwrap_or ( None )
177- . and_then ( |path| read_to_string ( path) . ok ( ) )
178- . unwrap_or_else ( String :: new)
179- } ) ;
180-
181179 Ok ( ( ) )
182180 }
183181
You can’t perform that action at this time.
0 commit comments