summaryrefslogtreecommitdiff
path: root/settings.go
diff options
context:
space:
mode:
authorSuhaib Mujahid <[email protected]>2020-11-02 21:36:20 -0500
committerGitHub <[email protected]>2020-11-02 18:36:20 -0800
commitc3664193f3c05bd6ae48f153c6c41cd7d7a3d98b (patch)
tree554de5613b352af18e71821d84e0a747b8023ed8 /settings.go
parentad3ec3664d54779c4c2e49e41f85e886fbff343c (diff)
feat: Implement an option to control hash verification (#671)
Add a binding to enable/disable hash verification using the `GIT_OPT_ENABLE_STRICT_HASH_VERIFICATION` option. Change type: #minor
Diffstat (limited to 'settings.go')
-rw-r--r--settings.go8
1 files changed, 8 insertions, 0 deletions
diff --git a/settings.go b/settings.go
index 9f2ec02..9325618 100644
--- a/settings.go
+++ b/settings.go
@@ -93,6 +93,14 @@ func EnableCaching(enabled bool) error {
}
}
+func EnableStrictHashVerification(enabled bool) error {
+ if enabled {
+ return setSizet(C.GIT_OPT_ENABLE_STRICT_HASH_VERIFICATION, 1)
+ } else {
+ return setSizet(C.GIT_OPT_ENABLE_STRICT_HASH_VERIFICATION, 0)
+ }
+}
+
func CachedMemory() (current int, allowed int, err error) {
return getSizetSizet(C.GIT_OPT_GET_CACHED_MEMORY)
}