This adds support for the GIT_OPT_ENABLE_FSYNC_GITDIR option in libgit2.
Co-authored-by: James Fargher <jfargher@gitlab.com>
(cherry picked from commit 1fcc9d8743
)
Co-authored-by: James Fargher <proglottis@gmail.com>
This commit is contained in:
parent
a964575453
commit
a3f32b93cd
|
@ -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) {
|
func CachedMemory() (current int, allowed int, err error) {
|
||||||
return getSizetSizet(C.GIT_OPT_GET_CACHED_MEMORY)
|
return getSizetSizet(C.GIT_OPT_GET_CACHED_MEMORY)
|
||||||
}
|
}
|
||||||
|
|
|
@ -65,6 +65,14 @@ func TestEnableStrictHashVerification(t *testing.T) {
|
||||||
checkFatal(t, err)
|
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) {
|
func TestCachedMemory(t *testing.T) {
|
||||||
current, allowed, err := CachedMemory()
|
current, allowed, err := CachedMemory()
|
||||||
checkFatal(t, err)
|
checkFatal(t, err)
|
||||||
|
|
Loading…
Reference in New Issue