Thread (73 messages) flat view 73 messages, 8 authors, 2016-06-15
STALE3743d

Revision v4 of 3 in this series.

Revisions (3)
  1. v4 current
  2. v5 [diff vs current]
  3. v6 [diff vs current]

[PATCH v4 09/45] sequencer: remove useless indentation

From: Felipe Contreras <hidden>
Date: 2016-06-15 22:57:37
Subsystem: the rest · Maintainer: Linus Torvalds

By using good ol' goto.

Signed-off-by: Felipe Contreras <redacted>
---
 builtin/sequencer.c | 10 ++++++----
 1 file changed, 6 insertions(+), 4 deletions(-)
diff --git a/builtin/sequencer.c b/builtin/sequencer.c
index e92e039..b2c8c94 100644
--- a/builtin/sequencer.c
+++ b/builtin/sequencer.c
@@ -390,7 +390,7 @@ static int do_pick_commit(struct commit *commit, struct replay_opts *opts)
 	struct commit_message msg = { NULL, NULL, NULL, NULL, NULL };
 	char *defmsg = NULL;
 	struct strbuf msgbuf = STRBUF_INIT;
-	int res, unborn = 0;
+	int res, unborn = 0, allow;
 
 	if (opts->no_commit) {
 		/*
@@ -535,14 +535,16 @@ static int do_pick_commit(struct commit *commit, struct replay_opts *opts)
 		      msg.subject);
 		print_advice(res == 1, opts);
 		rerere(opts->allow_rerere_auto);
-	} else {
-		int allow = allow_empty(opts, commit);
+		goto leave;
+	}
+
+	allow = allow_empty(opts, commit);
 	if (allow < 0)
 		return allow;
 	if (!opts->no_commit)
 		res = run_git_commit(defmsg, opts, allow);
-	}
 
+leave:
 	free_message(&msg);
 	free(defmsg);
 
-- 
1.8.3.698.g079b096
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help