Thread (25 messages) flat view 25 messages, 2 authors, 2016-06-15
DORMANTno replies

[PATCH 01/20] gettextize: git-clean clean.requireForce braces

From: Ævar Arnfjörð Bjarmason <hidden>
Date: 2016-06-15 22:49:30
Subsystem: the rest · Maintainer: Linus Torvalds

Use braces around a nested if/if/else to appease GCC, which'll whine
under -Wall and "suggest explicit braces to avoid ambiguous ‘else’".

This code was originally added in "gettextize: git-clean
clean.requireForce messages", and tested under clang (which doesn't
whine about perfectly valid uses of C).

Signed-off-by: Ævar Arnfjörð Bjarmason <redacted>
---
 builtin/clean.c |    3 ++-
 1 files changed, 2 insertions(+), 1 deletions(-)
diff --git a/builtin/clean.c b/builtin/clean.c
index 50ade84..52ec17a 100644
--- a/builtin/clean.c
+++ b/builtin/clean.c
@@ -77,13 +77,14 @@ int cmd_clean(int argc, const char **argv, const char *prefix)
 	if (ignored && ignored_only)
 		die(_("-x and -X cannot be used together"));
 
-	if (!show_only && !force)
+	if (!show_only && !force) {
 		if (config_set)
 			die(_("clean.requireForce set to true and neither -n nor -f given; "
 				  "refusing to clean"));
 		else
 			die(_("clean.requireForce defaults to true and neither -n nor -f given; "
 				  "refusing to clean"));
+	}
 
 	if (force > 1)
 		rm_flags = 0;
-- 
1.7.2.3.313.gcd15
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help