diff --git a/urmoms.c b/urmoms.c index 159e095..6a7b185 100644 --- a/urmoms.c +++ b/urmoms.c @@ -37,7 +37,6 @@ writeheader(FILE *fp) relpath, name, description); fprintf(fp, "Log | ", relpath); fprintf(fp, "Files", relpath); - /*fprintf(fp, "| Stats", relpath);*/ if (hasreadme) fprintf(fp, " | README", relpath); if (haslicense) @@ -212,12 +211,14 @@ printshowfile(git_commit *commit) git_diff *diff = NULL; git_diff_stats *diffstats = NULL; git_buf diffstatsbuf; + FILE *fp; size_t i, j, k, ndeltas, nhunks = 0, nhunklines = 0; char buf[GIT_OID_HEXSZ + 1], path[PATH_MAX]; - FILE *fp; int error; git_oid_tostr(buf, sizeof(buf), git_commit_id(commit)); + if (!buf[0]) + return; snprintf(path, sizeof(path), "commit/%s.html", buf); /* check if file exists if so skip it */ if (!access(path, F_OK)) @@ -334,11 +335,11 @@ writelog(FILE *fp) git_oid id; git_commit *commit = NULL; const git_signature *author; - git_diff_stats *stats; + git_diff_stats *stats = NULL; git_tree *commit_tree = NULL, *parent_tree = NULL; git_commit *parent = NULL; git_diff *diff = NULL; - size_t i, nfiles, ndel, nadd; + size_t nfiles, ndel, nadd; const char *summary; char buf[GIT_OID_HEXSZ + 1]; int error, ret = 0; @@ -349,14 +350,9 @@ writelog(FILE *fp) git_revwalk_push_head(w); /* TODO: also make "expanded" log ? (with message body) */ - i = 0; /* DEBUG: to limit commits */ fputs("
Commit message | Author | Age | " "Files | + | - |