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 {
131
131
self . input
132
132
. set_title ( strings:: commit_title ( & self . key_config ) ) ;
133
133
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
+
134
140
if self . is_empty ( ) {
135
141
if let Some ( s) = & self . commit_template {
136
142
self . input . set_text ( s. clone ( ) ) ;
@@ -170,14 +176,6 @@ impl CommitComponent {
170
176
pub fn update ( & mut self ) -> Result < ( ) > {
171
177
self . git_branch_name . lookup ( ) . map ( Some ) . unwrap_or ( None ) ;
172
178
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
-
181
179
Ok ( ( ) )
182
180
}
183
181
You can’t perform that action at this time.
0 commit comments