diff options
| author | Tony De La Nuez <tony.delanuez@gmail.com> | 2020-04-20 22:16:52 +0000 |
|---|---|---|
| committer | Edward Thomson <ethomson@edwardthomson.com> | 2021-07-30 10:29:51 -0400 |
| commit | cd460522c516f18a12549626a356960370e3bcc7 (patch) | |
| tree | 484bb83eabb272fef6a4f1f36426a4ceb0b72be4 /include/git2/common.h | |
| parent | cc68c19a3a6f025d94e332e856f43ab438dfbf08 (diff) | |
| download | libgit2-cd460522c516f18a12549626a356960370e3bcc7.tar.gz | |
odb: Implement option for overriding of default odb backend priority
Introduce GIT_OPT_SET_ODB_LOOSE_PRIORITY and GIT_OPT_SET_ODB_PACKED_PRIORITY
to allow overriding the default priority values for the default ODB
backends. Libgit2 has historically assumed that most objects for long-
running operations will be packed, therefore GIT_LOOSE_PRIORITY is
set to 1 by default, and GIT_PACKED_PRIORITY to 2.
When a client allows libgit2 to set the default backends, they can
specify an override for the two priority values in order to change
the order in which each ODB backend is accessed.
Diffstat (limited to 'include/git2/common.h')
| -rw-r--r-- | include/git2/common.h | 12 |
1 files changed, 11 insertions, 1 deletions
diff --git a/include/git2/common.h b/include/git2/common.h index dee260e05..4402dfda8 100644 --- a/include/git2/common.h +++ b/include/git2/common.h @@ -207,7 +207,9 @@ typedef enum { GIT_OPT_DISABLE_PACK_KEEP_FILE_CHECKS, GIT_OPT_ENABLE_HTTP_EXPECT_CONTINUE, GIT_OPT_GET_MWINDOW_FILE_LIMIT, - GIT_OPT_SET_MWINDOW_FILE_LIMIT + GIT_OPT_SET_MWINDOW_FILE_LIMIT, + GIT_OPT_SET_ODB_PACKED_PRIORITY, + GIT_OPT_SET_ODB_LOOSE_PRIORITY } git_libgit2_opt_t; /** @@ -421,6 +423,14 @@ typedef enum { * > authentication, use expect/continue when POSTing data. * > This option is not available on Windows. * + * opts(GIT_OPT_SET_ODB_PACKED_PRIORITY, int priority) + * > Override the default priority of the packed ODB backend which + * > is added when default backends are assigned to a repository + * + * opts(GIT_OPT_SET_ODB_LOOSE_PRIORITY, int priority) + * > Override the default priority of the loose ODB backend which + * > is added when default backends are assigned to a repository + * * @param option Option key * @param ... value to set the option * @return 0 on success, <0 on failure |
