From a73ca0483c5e1e9be3d083b6f15067a7717bf416 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Mon, 7 Dec 2015 19:58:19 +0100 Subject: [PATCH] simplify + style fixes --- urmoms.c | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) diff --git a/urmoms.c b/urmoms.c index e467fe5..44a4253 100644 --- a/urmoms.c +++ b/urmoms.c @@ -174,7 +174,7 @@ printcommit(FILE *fp, git_commit *commit) if ((count = (int)git_commit_parentcount(commit)) > 1) { fprintf(fp, "Merge:"); - for (i = 0; i < count; ++i) { + for (i = 0; i < count; i++) { git_oid_tostr(buf, 8, git_commit_parent_id(commit, i)); fprintf(fp, " %s", relpath, buf, buf); @@ -430,7 +430,7 @@ printcommitatom(FILE *fp, git_commit *commit) if ((count = (int)git_commit_parentcount(commit)) > 1) { fprintf(fp, "Merge:"); - for (i = 0; i < count; ++i) { + for (i = 0; i < count; i++) { git_oid_tostr(buf, 8, git_commit_parent_id(commit, i)); fprintf(fp, " %s", buf); } @@ -569,12 +569,10 @@ main(int argc, char *argv[]) fclose(fpread); } - /* read LICENSE */ - if (!git_revparse_single(&obj, repo, "HEAD:LICENSE")) - haslicense = 1; - /* read README */ - if (!git_revparse_single(&obj, repo, "HEAD:README")) - hasreadme = 1; + /* check LICENSE */ + haslicense = !git_revparse_single(&obj, repo, "HEAD:LICENSE"); + /* check README */ + hasreadme = !git_revparse_single(&obj, repo, "HEAD:README"); /* read LICENSE */ if (!git_revparse_single(&obj, repo, "HEAD:LICENSE")) { -- 2.30.2