name-rev: wrap both blocks in braces

See `CodingGuidelines`: - When there are multiple arms to a conditional and some of them require braces, enclose even a single line block in braces for consistency. [...] Signed-off-by: Kristoffer Haugsbakk <code@khaugsbakk.name> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Kristoffer Haugsbakk committed May 11, 2026 at 17:45 UTC 7c78d24c52d65f4442e521c575ef887481a38439
1 file changed +4 -4
builtin/name-rev.c
+4 -4
@@ -466,9 +466,9 @@ static const char *get_rev_name(const struct object *o, struct strbuf *buf)
466 if (!n)
467 return NULL;
468
469 - if (!n->generation)
469 + if (!n->generation) {
470 return n->tip_name;
471 - else {
471 + } else {
472 strbuf_reset(buf);
473 strbuf_addstr(buf, n->tip_name);
474 strbuf_strip_suffix(buf, "^0");
@@ -516,9 +516,9 @@ static void name_rev_line(char *p, struct name_ref_data *data)
516
517 for (p_start = p; *p; p++) {
518 #define ishex(x) (isdigit((x)) || ((x) >= 'a' && (x) <= 'f'))
519 - if (!ishex(*p))
519 + if (!ishex(*p)) {
520 counter = 0;
521 - else if (++counter == hexsz &&
521 + } else if (++counter == hexsz &&
522 !ishex(*(p+1))) {
523 struct object_id oid;
524 const char *name = NULL;