stagit-gopher

[fork] gopher git frontend
Log | Files | Refs | README | LICENSE

commit 326c0b91ac136447c1cb3f6cc2dc2053f320a5ee
parent 92f9bf9f3a5efb6ac7bec3760645f6e4888c5143
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Fri, 23 Jun 2017 12:29:11 +0200

separate commitinfo_getstats from commitinfo_getbyoid

diffstat fields are not used in each view, this is faster.

Diffstat:
Mstagit-gopher.c | 7+++++--
1 file changed, 5 insertions(+), 2 deletions(-)

diff --git a/stagit-gopher.c b/stagit-gopher.c @@ -238,8 +238,6 @@ commitinfo_getbyoid(const git_oid *id) opts.flags |= GIT_DIFF_DISABLE_PATHSPEC_MATCH; if (git_diff_tree_to_tree(&(ci->diff), repo, ci->parent_tree, ci->commit_tree, &opts)) goto err; - if (commitinfo_getstats(ci) == -1) - goto err; return ci; @@ -678,12 +676,17 @@ writelog(FILE *fp, const git_oid *oid) /* check if file exists if so skip it */ if (access(path, F_OK)) { + /* lookup stats: only required here */ + if (commitinfo_getstats(ci) == -1) + goto err; + fpfile = efopen(path, "w"); writeheader(fpfile, ci->summary); printshowfile(fpfile, ci); writefooter(fpfile); fclose(fpfile); } +err: commitinfo_free(ci); } git_revwalk_free(w);