iseparate commitinfo_getstats from commitinfo_getbyoid - stagit-gopher - A git gopher frontend. (mirror) Err bitreich.org 70 hgit clone git://bitreich.org/stagit-gopher/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/stagit-gopher/ URL:git://bitreich.org/stagit-gopher/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/stagit-gopher/ bitreich.org 70 1Log /scm/stagit-gopher/log.gph bitreich.org 70 1Files /scm/stagit-gopher/files.gph bitreich.org 70 1Refs /scm/stagit-gopher/refs.gph bitreich.org 70 1Tags /scm/stagit-gopher/tag bitreich.org 70 1README /scm/stagit-gopher/file/README.gph bitreich.org 70 1LICENSE /scm/stagit-gopher/file/LICENSE.gph bitreich.org 70 i--- Err bitreich.org 70 1commit 326c0b91ac136447c1cb3f6cc2dc2053f320a5ee /scm/stagit-gopher/commit/326c0b91ac136447c1cb3f6cc2dc2053f320a5ee.gph bitreich.org 70 1parent 92f9bf9f3a5efb6ac7bec3760645f6e4888c5143 /scm/stagit-gopher/commit/92f9bf9f3a5efb6ac7bec3760645f6e4888c5143.gph bitreich.org 70 hAuthor: Hiltjo Posthuma URL:mailto:hiltjo@codemadness.org bitreich.org 70 iDate: Fri, 23 Jun 2017 12:29:11 +0200 Err bitreich.org 70 i Err bitreich.org 70 iseparate commitinfo_getstats from commitinfo_getbyoid Err bitreich.org 70 i Err bitreich.org 70 idiffstat fields are not used in each view, this is faster. Err bitreich.org 70 i Err bitreich.org 70 iDiffstat: Err bitreich.org 70 i M stagit-gopher.c | 7 +++++-- Err bitreich.org 70 i Err bitreich.org 70 i1 file changed, 5 insertions(+), 2 deletions(-) Err bitreich.org 70 i--- Err bitreich.org 70 1diff --git a/stagit-gopher.c b/stagit-gopher.c /scm/stagit-gopher/file/stagit-gopher.c.gph bitreich.org 70 i@@ -238,8 +238,6 @@ commitinfo_getbyoid(const git_oid *id) Err bitreich.org 70 i opts.flags |= GIT_DIFF_DISABLE_PATHSPEC_MATCH; Err bitreich.org 70 i if (git_diff_tree_to_tree(&(ci->diff), repo, ci->parent_tree, ci->commit_tree, &opts)) Err bitreich.org 70 i goto err; Err bitreich.org 70 i- if (commitinfo_getstats(ci) == -1) Err bitreich.org 70 i- goto err; Err bitreich.org 70 i Err bitreich.org 70 i return ci; Err bitreich.org 70 i Err bitreich.org 70 i@@ -678,12 +676,17 @@ writelog(FILE *fp, const git_oid *oid) Err bitreich.org 70 i Err bitreich.org 70 i /* check if file exists if so skip it */ Err bitreich.org 70 i if (access(path, F_OK)) { Err bitreich.org 70 i+ /* lookup stats: only required here */ Err bitreich.org 70 i+ if (commitinfo_getstats(ci) == -1) Err bitreich.org 70 i+ goto err; Err bitreich.org 70 i+ Err bitreich.org 70 i fpfile = efopen(path, "w"); Err bitreich.org 70 i writeheader(fpfile, ci->summary); Err bitreich.org 70 i printshowfile(fpfile, ci); Err bitreich.org 70 i writefooter(fpfile); Err bitreich.org 70 i fclose(fpfile); Err bitreich.org 70 i } Err bitreich.org 70 i+err: Err bitreich.org 70 i commitinfo_free(ci); Err bitreich.org 70 i } Err bitreich.org 70 i git_revwalk_free(w); Err bitreich.org 70 .