summaryrefslogtreecommitdiff
path: root/include/git2
diff options
context:
space:
mode:
authorPatrick Steinhardt <ps@pks.im>2018-07-26 15:25:44 +0200
committerGitHub <noreply@github.com>2018-07-26 15:25:44 +0200
commit42f8384045ca325c6885be21a89c3d8027995e03 (patch)
treee6c40a543edeb3a48635386b2703168c9774446b /include/git2
parent7d3930a15e4b4eb292c0e24debdf1b39a6d7d63b (diff)
parent328103482aceca6789e2e8644c28637aadc4c2c2 (diff)
downloadlibgit2-42f8384045ca325c6885be21a89c3d8027995e03.tar.gz
Merge pull request #4721 from nelhage/max-objects
Add a configurable limit to the max pack size that will be indexed
Diffstat (limited to 'include/git2')
-rw-r--r--include/git2/common.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/include/git2/common.h b/include/git2/common.h
index 8c9347413..a14e0961e 100644
--- a/include/git2/common.h
+++ b/include/git2/common.h
@@ -195,7 +195,9 @@ typedef enum {
GIT_OPT_SET_WINDOWS_SHAREMODE,
GIT_OPT_ENABLE_STRICT_HASH_VERIFICATION,
GIT_OPT_SET_ALLOCATOR,
- GIT_OPT_ENABLE_UNSAVED_INDEX_SAFETY
+ GIT_OPT_ENABLE_UNSAVED_INDEX_SAFETY,
+ GIT_OPT_GET_PACK_MAX_OBJECTS,
+ GIT_OPT_SET_PACK_MAX_OBJECTS
} git_libgit2_opt_t;
/**
@@ -372,6 +374,18 @@ typedef enum {
* > fail. (Using the FORCE flag to checkout will still overwrite
* > these changes.)
*
+ * opts(GIT_OPT_GET_PACK_MAX_OBJECTS, size_t *out)
+ *
+ * > Get the maximum number of objects libgit2 will allow in a pack
+ * > file when downloading a pack file from a remote. This can be
+ * > used to limit maximum memory usage when fetching from an untrusted
+ * > remote.
+ *
+ * opts(GIT_OPT_SET_PACK_MAX_OBJECTS, size_t objects)
+ *
+ * > Set the maximum number of objects libgit2 will allow in a pack
+ * > file when downloading a pack file from a remote.
+ *
* @param option Option key
* @param ... value to set the option
* @return 0 on success, <0 on failure