summaryrefslogtreecommitdiff
path: root/tests/pack
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@github.com>2017-02-17 16:48:03 +0000
committerEdward Thomson <ethomson@github.com>2017-02-28 13:29:01 +0000
commit3ac05d11493d0573dbf725a19403dbf5e8d93b50 (patch)
treedf266808fd9a87c58b402c83eb1aa60f7bbc9376 /tests/pack
parent2a5ad7d0f2c28337530855fae250f85123070fcb (diff)
downloadlibgit2-3ac05d11493d0573dbf725a19403dbf5e8d93b50.tar.gz
win32: don't fsync parent directories on Windows
Windows doesn't support it.
Diffstat (limited to 'tests/pack')
-rw-r--r--tests/pack/packbuilder.c11
1 files changed, 10 insertions, 1 deletions
diff --git a/tests/pack/packbuilder.c b/tests/pack/packbuilder.c
index 96d643ab7..5cdd9a8d2 100644
--- a/tests/pack/packbuilder.c
+++ b/tests/pack/packbuilder.c
@@ -200,11 +200,20 @@ void test_pack_packbuilder__does_not_fsync_by_default(void)
void test_pack_packbuilder__fsync_when_asked(void)
{
+ /* We fsync the packfile and index. On non-Windows, we also fsync
+ * the parent directories.
+ */
+#ifdef GIT_WIN32
+ int expected = 2;
+#else
+ int expected = 4;
+#endif
+
cl_git_pass(git_libgit2_opts(GIT_OPT_ENABLE_SYNCHRONOUS_OBJECT_CREATION, 1));
p_fsync__cnt = 0;
seed_packbuilder();
git_packbuilder_write(_packbuilder, ".", 0666, NULL, NULL);
- cl_assert_equal_sz(4, p_fsync__cnt);
+ cl_assert_equal_sz(expected, p_fsync__cnt);
}
static int foreach_cb(void *buf, size_t len, void *payload)