File tree Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Expand file tree Collapse file tree 2 files changed +17
-1
lines changed Original file line number Diff line number Diff line change @@ -93,6 +93,14 @@ func EnableCaching(enabled bool) error {
9393 }
9494}
9595
96+ func EnableStrictHashVerification (enabled bool ) error {
97+ if enabled {
98+ return setSizet (C .GIT_OPT_ENABLE_STRICT_HASH_VERIFICATION , 1 )
99+ } else {
100+ return setSizet (C .GIT_OPT_ENABLE_STRICT_HASH_VERIFICATION , 0 )
101+ }
102+ }
103+
96104func CachedMemory () (current int , allowed int , err error ) {
97105 return getSizetSizet (C .GIT_OPT_GET_CACHED_MEMORY )
98106}
Original file line number Diff line number Diff line change @@ -57,6 +57,14 @@ func TestEnableCaching(t *testing.T) {
5757 checkFatal (t , err )
5858}
5959
60+ func TestEnableStrictHashVerification (t * testing.T ) {
61+ err := EnableStrictHashVerification (false )
62+ checkFatal (t , err )
63+
64+ err = EnableStrictHashVerification (true )
65+ checkFatal (t , err )
66+ }
67+
6068func TestCachedMemory (t * testing.T ) {
6169 current , allowed , err := CachedMemory ()
6270 checkFatal (t , err )
@@ -80,4 +88,4 @@ func TestSetCacheMaxSize(t *testing.T) {
8088 // revert to default 256MB
8189 err = SetCacheMaxSize (256 * 1024 * 1024 )
8290 checkFatal (t , err )
83- }
91+ }
You can’t perform that action at this time.
0 commit comments