diff mbox series

[07/23] builtin/checkout.c: Fix coding style

Message ID 20220430041406.164719-8-gitter.spiros@gmail.com (mailing list archive)
State New, archived
Headers show
Series add a new coccinelle semantic patch to enforce a | expand

Commit Message

Elia Pinto April 30, 2022, 4:13 a.m. UTC
Adhere to the git coding style which requires "Do not explicitly compute an
integral value with constant 0 or '\ 0', or a pointer value with constant NULL."

Signed-off-by: Elia Pinto <gitter.spiros@gmail.com>
---
 builtin/checkout.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
diff mbox series

Patch

diff --git a/builtin/checkout.c b/builtin/checkout.c
index 797681481d..f988936ddf 100644
--- a/builtin/checkout.c
+++ b/builtin/checkout.c
@@ -834,7 +834,7 @@  static int merge_working_tree(const struct checkout_opts *opts,
 			if (ret)
 				return ret;
 			o.ancestor = old_branch_info->name;
-			if (old_branch_info->name == NULL) {
+			if (!old_branch_info->name) {
 				strbuf_add_unique_abbrev(&old_commit_shortname,
 							 &old_branch_info->commit->object.oid,
 							 DEFAULT_ABBREV);