diff options
author | Edward Thomson <ethomson@microsoft.com> | 2015-01-12 16:16:27 -0600 |
---|---|---|
committer | Edward Thomson <ethomson@microsoft.com> | 2015-01-20 17:12:23 -0600 |
commit | 1d50b3649d578f12918b7996ad7b98a438bc0616 (patch) | |
tree | 57ee1b06924739f57a3c3b98cffd58ee7d02740d /include/git2/checkout.h | |
parent | 93b4a50de1b124bf1808dbe55b9b5352274622e1 (diff) | |
download | libgit2-1d50b3649d578f12918b7996ad7b98a438bc0616.tar.gz |
checkout: introduce git_checkout_perfdata
Checkout can now provide performance data about the number of (some)
syscalls performed using an optional callback.
Diffstat (limited to 'include/git2/checkout.h')
-rw-r--r-- | include/git2/checkout.h | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/include/git2/checkout.h b/include/git2/checkout.h index fe4966aa2..ffbb53fc5 100644 --- a/include/git2/checkout.h +++ b/include/git2/checkout.h @@ -206,6 +206,12 @@ typedef enum { GIT_CHECKOUT_NOTIFY_ALL = 0x0FFFFu } git_checkout_notify_t; +typedef struct { + size_t mkdir_calls; + size_t stat_calls; + size_t chmod_calls; +} git_checkout_perfdata; + /** Checkout notification callback function */ typedef int (*git_checkout_notify_cb)( git_checkout_notify_t why, @@ -222,6 +228,11 @@ typedef void (*git_checkout_progress_cb)( size_t total_steps, void *payload); +/** Checkout perfdata notification function */ +typedef void (*git_checkout_perfdata_cb)( + const git_checkout_perfdata *perfdata, + void *payload); + /** * Checkout options structure * @@ -261,6 +272,10 @@ typedef struct git_checkout_options { const char *ancestor_label; /**< the name of the common ancestor side of conflicts */ const char *our_label; /**< the name of the "our" side of conflicts */ const char *their_label; /**< the name of the "their" side of conflicts */ + + /** Optional callback to notify the consumer of performance data. */ + git_checkout_perfdata_cb perfdata_cb; + void *perfdata_payload; } git_checkout_options; #define GIT_CHECKOUT_OPTIONS_VERSION 1 |