diff options
| author | Vicent Marti <vicent@github.com> | 2014-05-02 09:50:15 -0700 |
|---|---|---|
| committer | Vicent Marti <vicent@github.com> | 2014-05-02 09:50:15 -0700 |
| commit | 272b462db7cfb50c1ab69e1edda214b21f242ae5 (patch) | |
| tree | 13c7a7ef6e7ef1e6d90949e60a3d4677ef9096e4 /include/git2/sys/diff.h | |
| parent | 9862ef8ef8ffd95a74be8082acab9fea0de85edb (diff) | |
| parent | 99dfa470398b9c4e06e5a5ee61868d3b9e21b26e (diff) | |
| download | libgit2-272b462db7cfb50c1ab69e1edda214b21f242ae5.tar.gz | |
Merge pull request #2308 from libgit2/rb/diff-update-index-stat-cache
Reduce excessive OID calculation for diff and stat
Diffstat (limited to 'include/git2/sys/diff.h')
| -rw-r--r-- | include/git2/sys/diff.h | 28 |
1 files changed, 28 insertions, 0 deletions
diff --git a/include/git2/sys/diff.h b/include/git2/sys/diff.h index bc6cdf393..48d72f4f9 100644 --- a/include/git2/sys/diff.h +++ b/include/git2/sys/diff.h @@ -10,6 +10,8 @@ #include "git2/common.h" #include "git2/types.h" #include "git2/oid.h" +#include "git2/diff.h" +#include "git2/status.h" /** * @file git2/sys/diff.h @@ -58,6 +60,32 @@ GIT_EXTERN(int) git_diff_print_callback__to_file_handle( const git_diff_line *line, void *payload); /*< payload must be a `FILE *` */ + +typedef struct { + unsigned int version; + size_t stat_calls; + size_t oid_calculations; +} git_diff_perfdata; + +#define GIT_DIFF_PERFDATA_VERSION 1 +#define GIT_DIFF_PERFDATA_INIT {GIT_DIFF_PERFDATA_VERSION,0,0} + +/** + * Get performance data for a diff object. + * + * @param out Structure to be filled with diff performance data + * @param diff Diff to read performance data from + * @return 0 for success, <0 for error + */ +GIT_EXTERN(int) git_diff_get_perfdata( + git_diff_perfdata *out, const git_diff *diff); + +/** + * Get performance data for diffs from a git_status_list + */ +GIT_EXTERN(int) git_status_list_get_perfdata( + git_diff_perfdata *out, const git_status_list *status); + /** @} */ GIT_END_DECL #endif |
