Skip to content

Commit 7fe5a5f

Browse files
LemmingAvalanchegitster
authored andcommitted
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>
1 parent 67ad421 commit 7fe5a5f

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

builtin/name-rev.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -466,9 +466,9 @@ static const char *get_rev_name(const struct object *o, struct strbuf *buf)
466466
if (!n)
467467
return NULL;
468468

469-
if (!n->generation)
469+
if (!n->generation) {
470470
return n->tip_name;
471-
else {
471+
} else {
472472
strbuf_reset(buf);
473473
strbuf_addstr(buf, n->tip_name);
474474
strbuf_strip_suffix(buf, "^0");
@@ -516,9 +516,9 @@ static void name_rev_line(char *p, struct name_ref_data *data)
516516

517517
for (p_start = p; *p; p++) {
518518
#define ishex(x) (isdigit((x)) || ((x) >= 'a' && (x) <= 'f'))
519-
if (!ishex(*p))
519+
if (!ishex(*p)) {
520520
counter = 0;
521-
else if (++counter == hexsz &&
521+
} else if (++counter == hexsz &&
522522
!ishex(*(p+1))) {
523523
struct object_id oid;
524524
const char *name = NULL;

0 commit comments

Comments
 (0)