From: Hiltjo Posthuma Date: Sat, 7 May 2016 12:34:26 +0000 (+0200) Subject: simplify, no need for goto X-Git-Url: https://git.armaanb.net/?p=stagit.git;a=commitdiff_plain;h=f89c317dee3006e0c7b88832d7c74e30f646036c simplify, no need for goto --- diff --git a/stagit.c b/stagit.c index 4048873..6a79573 100644 --- a/stagit.c +++ b/stagit.c @@ -866,12 +866,10 @@ writefiles(FILE *fp, const git_oid *id, const char *branch) "ModeNameSize" "\n\n", fp); - if (git_commit_lookup(&commit, repo, id) || - git_commit_tree(&tree, commit)) - goto err; - ret = writefilestree(fp, tree, branch, ""); + if (!git_commit_lookup(&commit, repo, id) && + !git_commit_tree(&tree, commit)) + ret = writefilestree(fp, tree, branch, ""); -err: fputs("", fp); git_commit_free(commit);