iperformance tweak: check if commit file exists, if so skip - 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 a0dbff9161f92990ff07e8728ad07dfe16c3aef1 /scm/stagit-gopher/commit/a0dbff9161f92990ff07e8728ad07dfe16c3aef1.gph bitreich.org 70 1parent 8de7a32f0744acd6a8279470861440bd287a1bd4 /scm/stagit-gopher/commit/8de7a32f0744acd6a8279470861440bd287a1bd4.gph bitreich.org 70 hAuthor: Hiltjo Posthuma URL:mailto:hiltjo@codemadness.org bitreich.org 70 iDate: Mon, 7 Dec 2015 21:34:53 +0100 Err bitreich.org 70 i Err bitreich.org 70 iperformance tweak: check if commit file exists, if so skip Err bitreich.org 70 i Err bitreich.org 70 iDiffstat: Err bitreich.org 70 i M urmoms.c | 6 +++++- Err bitreich.org 70 i Err bitreich.org 70 i1 file changed, 5 insertions(+), 1 deletion(-) Err bitreich.org 70 i--- Err bitreich.org 70 1diff --git a/urmoms.c b/urmoms.c /scm/stagit-gopher/file/urmoms.c.gph bitreich.org 70 i@@ -7,6 +7,7 @@ Err bitreich.org 70 i #include Err bitreich.org 70 i #include Err bitreich.org 70 i #include Err bitreich.org 70 i+#include Err bitreich.org 70 i Err bitreich.org 70 i #include "git2.h" Err bitreich.org 70 i Err bitreich.org 70 i@@ -218,10 +219,13 @@ printshowfile(git_commit *commit) Err bitreich.org 70 i Err bitreich.org 70 i git_oid_tostr(buf, sizeof(buf), git_commit_id(commit)); Err bitreich.org 70 i snprintf(path, sizeof(path), "commit/%s.html", buf); Err bitreich.org 70 i- fp = efopen(path, "w+b"); 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+ return; Err bitreich.org 70 i Err bitreich.org 70 i memset(&diffstatsbuf, 0, sizeof(diffstatsbuf)); Err bitreich.org 70 i Err bitreich.org 70 i+ fp = efopen(path, "w+b"); Err bitreich.org 70 i writeheader(fp); Err bitreich.org 70 i printcommit(fp, commit); Err bitreich.org 70 i Err bitreich.org 70 .