Skip to content

Commit c8d1351

Browse files
felipecgitster
authored andcommitted
sequencer: remove useless indentation
By using good ol' goto. Signed-off-by: Felipe Contreras <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent edca415 commit c8d1351

File tree

1 file changed

+9
-7
lines changed

1 file changed

+9
-7
lines changed

sequencer.c

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -474,7 +474,7 @@ static int do_pick_commit(struct commit *commit, struct replay_opts *opts)
474474
struct commit_message msg = { NULL, NULL, NULL, NULL, NULL };
475475
char *defmsg = NULL;
476476
struct strbuf msgbuf = STRBUF_INIT;
477-
int res, unborn = 0;
477+
int res, unborn = 0, allow;
478478

479479
if (opts->no_commit) {
480480
/*
@@ -624,14 +624,16 @@ static int do_pick_commit(struct commit *commit, struct replay_opts *opts)
624624
msg.subject);
625625
print_advice(res == 1, opts);
626626
rerere(opts->allow_rerere_auto);
627-
} else {
628-
int allow = allow_empty(opts, commit);
629-
if (allow < 0)
630-
return allow;
631-
if (!opts->no_commit)
632-
res = run_git_commit(defmsg, opts, allow);
627+
goto leave;
633628
}
634629

630+
allow = allow_empty(opts, commit);
631+
if (allow < 0)
632+
return allow;
633+
if (!opts->no_commit)
634+
res = run_git_commit(defmsg, opts, allow);
635+
636+
leave:
635637
free_message(&msg);
636638
free(defmsg);
637639

0 commit comments

Comments
 (0)