From aa3b813f1425bd1ffd5b08d94ce4f13e7ba1a6c3 Mon Sep 17 00:00:00 2001 From: Hiltjo Posthuma Date: Wed, 6 Jan 2016 18:50:38 +0100 Subject: [PATCH] cleanup code a bit --- stagit.c | 35 ++++------------------------------- 1 file changed, 4 insertions(+), 31 deletions(-) diff --git a/stagit.c b/stagit.c index c35a55b..b591b11 100644 --- a/stagit.c +++ b/stagit.c @@ -317,17 +317,6 @@ printcommit(FILE *fp, struct commitinfo *ci) fprintf(fp, "parent %s\n", relpath, ci->parentoid, ci->parentoid); -#if 0 - if ((count = (int)git_commit_parentcount(commit)) > 1) { - fputs("Merge:", fp); - for (i = 0; i < count; i++) { - git_oid_tostr(buf, 8, git_commit_parent_id(commit, i)); - fprintf(fp, " %s", - relpath, buf, buf); - } - fputc('\n', fp); - } -#endif if (ci->author) { fputs("Author: ", fp); xmlencode(fp, ci->author->name, strlen(ci->author->name)); @@ -531,18 +520,6 @@ printcommitatom(FILE *fp, struct commitinfo *ci) fprintf(fp, "commit %s\n", ci->oid); if (ci->parentoid[0]) fprintf(fp, "parent %s\n", ci->parentoid); - -#if 0 - if ((count = (int)git_commit_parentcount(commit)) > 1) { - fputs("Merge:", fp); - for (i = 0; i < count; i++) { - git_oid_tostr(buf, 8, git_commit_parent_id(commit, i)); - fprintf(fp, " %s", buf); - } - fputc('\n', fp); - } -#endif - if (ci->author) { fputs("Author: ", fp); xmlencode(fp, ci->author->name, strlen(ci->author->name)); @@ -821,15 +798,10 @@ writerefs(FILE *fp) for (j = 0; j < 2; j++) { for (i = 0, count = 0; i < refcount; i++) { - if (git_reference_is_branch(refs[i]) && j == 0) - ; - else if (git_reference_is_tag(refs[i]) && j == 1) - ; - else + if (!(git_reference_is_branch(refs[i]) && j == 0) && + !(git_reference_is_tag(refs[i]) && j == 1)) continue; - id = NULL; - r = NULL; switch (git_reference_type(refs[i])) { case GIT_REF_SYMBOLIC: if (git_reference_resolve(&dref, refs[i])) @@ -870,7 +842,8 @@ writerefs(FILE *fp) printtimeshort(fp, &(ci->author->when)); fputs("", fp); if (ci->summary) { - fprintf(fp, "", relpath, ci->oid); + fprintf(fp, "", + relpath, ci->oid); if ((len = strlen(ci->summary)) > summarylen) { xmlencode(fp, ci->summary, summarylen - 1); fputs("…", fp); -- libgit2 1.1.1