diff --git a/settings.go b/settings.go index 93256181..7f9b5b12 100644 --- a/settings.go +++ b/settings.go @@ -101,6 +101,14 @@ func EnableStrictHashVerification(enabled bool) error { } } +func EnableFsyncGitDir(enabled bool) error { + if enabled { + return setSizet(C.GIT_OPT_ENABLE_FSYNC_GITDIR, 1) + } else { + return setSizet(C.GIT_OPT_ENABLE_FSYNC_GITDIR, 0) + } +} + func CachedMemory() (current int, allowed int, err error) { return getSizetSizet(C.GIT_OPT_GET_CACHED_MEMORY) } diff --git a/settings_test.go b/settings_test.go index 47eb7116..e3761d45 100644 --- a/settings_test.go +++ b/settings_test.go @@ -65,6 +65,14 @@ func TestEnableStrictHashVerification(t *testing.T) { checkFatal(t, err) } +func TestEnableFsyncGitDir(t *testing.T) { + err := EnableFsyncGitDir(false) + checkFatal(t, err) + + err = EnableFsyncGitDir(true) + checkFatal(t, err) +} + func TestCachedMemory(t *testing.T) { current, allowed, err := CachedMemory() checkFatal(t, err)