Thread (11 messages) flat view 11 messages, 4 authors, 2021-07-09

RE: [PATCH v2 2/2] commit: remove irrelavent prompt on `--allow-empty-message`

From: Felipe Contreras <hidden>
Date: 2021-07-07 17:43:04

Hu Jialun wrote:
quoted hunk ↗ jump to hunk
--- a/builtin/commit.c
+++ b/builtin/commit.c
@@ -918,7 +918,9 @@ static int prepare_to_commit(const char *index_file, const char *prefix,
 		if (cleanup_mode == COMMIT_MSG_CLEANUP_ALL) {
 			status_printf_ln(s, GIT_COLOR_NORMAL, msg_enter_prompt);
 			status_printf_ln(s, GIT_COLOR_NORMAL, ignore_char_prompt, comment_line_char);
-			status_printf_ln(s, GIT_COLOR_NORMAL, empty_msg_abort_prompt);
+			if (!allow_empty_message) {
+				status_printf_ln(s, GIT_COLOR_NORMAL, empty_msg_abort_prompt);
+			}
In git the style is to avoid braces if the content of the condition is a
single line.

-- 
Felipe Contreras
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help