summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorDhruva Krishnamurthy <dhruvakm@gmail.com>2019-01-28 18:31:21 -0800
committerDhruva Krishnamurthy <dhruvakm@gmail.com>2019-02-02 07:56:03 -0800
commit004a339874ef697c781cd4cbe2437c0d95daef8a (patch)
tree8b8fbc6a381e559143502895351f8c2b5b458617 /tests
parent1a107fac0fc88a4d74b64ffc9ae2fd178ba631c0 (diff)
downloadlibgit2-004a339874ef697c781cd4cbe2437c0d95daef8a.tar.gz
Allow bypassing check '.keep' files using libgit2 option 'GIT_OPT_IGNORE_PACK_KEEP_FILE_CHECK'
Diffstat (limited to 'tests')
-rw-r--r--tests/pack/packbuilder.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/tests/pack/packbuilder.c b/tests/pack/packbuilder.c
index 6859001fe..394841e87 100644
--- a/tests/pack/packbuilder.c
+++ b/tests/pack/packbuilder.c
@@ -14,6 +14,8 @@ static git_vector _commits;
static int _commits_is_initialized;
static git_transfer_progress _stats;
+extern bool git_disable_pack_keep_file_checks;
+
void test_pack_packbuilder__initialize(void)
{
_repo = cl_git_sandbox_init("testrepo.git");
@@ -32,6 +34,7 @@ void test_pack_packbuilder__cleanup(void)
unsigned int i;
cl_git_pass(git_libgit2_opts(GIT_OPT_ENABLE_FSYNC_GITDIR, 0));
+ cl_git_pass(git_libgit2_opts(GIT_OPT_DISABLE_PACK_KEEP_FILE_CHECKS, false));
if (_commits_is_initialized) {
_commits_is_initialized = 0;
@@ -260,3 +263,10 @@ void test_pack_packbuilder__foreach_with_cancel(void)
git_packbuilder_foreach(_packbuilder, foreach_cancel_cb, idx), -1111);
git_indexer_free(idx);
}
+
+void test_pack_packbuilder__keep_file_check(void)
+{
+ assert(!git_disable_pack_keep_file_checks);
+ cl_git_pass(git_libgit2_opts(GIT_OPT_DISABLE_PACK_KEEP_FILE_CHECKS, true));
+ assert(git_disable_pack_keep_file_checks);
+}