summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2017-05-01 16:17:48 +0100
committerGitHub <noreply@github.com>2017-05-01 16:17:48 +0100
commit13c1bf0718363960c1867f35c9ce3ebc7bf74729 (patch)
treef3d0aee020f8d45ce2a0c0d9e0bf03501b0a8822 /include
parentd87028438621240406b73ddff5a9e488734cbda7 (diff)
parente0973bc0fc2b04b6bb27e4ce4db2b37e9577a75d (diff)
downloadlibgit2-13c1bf0718363960c1867f35c9ce3ebc7bf74729.tar.gz
Merge pull request #4197 from pks-t/pks/verify-object-hashes
Verify object hashes
Diffstat (limited to 'include')
-rw-r--r--include/git2/common.h8
-rw-r--r--include/git2/errors.h1
2 files changed, 9 insertions, 0 deletions
diff --git a/include/git2/common.h b/include/git2/common.h
index 6d2092028..d83e8c3a0 100644
--- a/include/git2/common.h
+++ b/include/git2/common.h
@@ -182,6 +182,7 @@ typedef enum {
GIT_OPT_ENABLE_SYNCHRONOUS_OBJECT_CREATION,
GIT_OPT_GET_WINDOWS_SHAREMODE,
GIT_OPT_SET_WINDOWS_SHAREMODE,
+ GIT_OPT_ENABLE_STRICT_HASH_VERIFICATION,
} git_libgit2_opt_t;
/**
@@ -337,6 +338,13 @@ typedef enum {
* > is written to permanent storage, not simply cached. This
* > defaults to disabled.
*
+ * opts(GIT_OPT_ENABLE_STRICT_HASH_VERIFICATION, int enabled)
+ *
+ * > Enable strict verification of object hashsums when reading
+ * > objects from disk. This may impact performance due to an
+ * > additional checksum calculation on each object. This defaults
+ * > to enabled.
+ *
* @param option Option key
* @param ... value to set the option
* @return 0 on success, <0 on failure
diff --git a/include/git2/errors.h b/include/git2/errors.h
index 71bff0f9d..6f5580253 100644
--- a/include/git2/errors.h
+++ b/include/git2/errors.h
@@ -54,6 +54,7 @@ typedef enum {
GIT_PASSTHROUGH = -30, /**< Internal only */
GIT_ITEROVER = -31, /**< Signals end of iteration with iterator */
GIT_RETRY = -32, /**< Internal only */
+ GIT_EMISMATCH = -33, /**< Hashsum mismatch in object */
} git_error_code;
/**