diff options
author | Hiltjo Posthuma <hiltjo@codemadness.org> | 2017-06-23 13:53:46 +0200 |
---|---|---|
committer | Hiltjo Posthuma <hiltjo@codemadness.org> | 2017-06-23 13:53:46 +0200 |
commit | f843248215c1f87d732b2aec27b1d30c0ceba163 (patch) | |
tree | fe458281999387dd1df1309ab30fd33fcb7e3eeb /stagit.c | |
parent | 54a8a7c1533ce60e3cbe8539bf1e801225d0fabd (diff) |
separate getstats from getbyoid: slightly faster
Diffstat (limited to 'stagit.c')
-rw-r--r-- | stagit.c | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -208,8 +208,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; @@ -575,6 +573,9 @@ writelog(FILE *fp, const git_oid *oid) break; if (!(ci = commitinfo_getbyoid(&id))) break; + /* lookup stats: only required here */ + if (commitinfo_getstats(ci) == -1) + goto err; writelogline(fp, ci); if (cachefile) @@ -596,6 +597,7 @@ writelog(FILE *fp, const git_oid *oid) writefooter(fpfile); fclose(fpfile); } +err: commitinfo_free(ci); } git_revwalk_free(w); |