Merge pull request #1197 from nulltoken/travis/run-online-tests travis: Include the online suite when running against Travis
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100
diff --git a/.travis.yml b/.travis.yml
index 8ce4903..c1e3490 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -33,7 +33,7 @@ script:
# Run Tests
after_script:
- - if [ -f ./libgit2_clar ]; then valgrind --leak-check=full --show-reachable=yes --suppressions=../libgit2_clar.supp ./libgit2_clar -iall; else echo "Skipping valgrind"; fi
+ - if [ -f ./libgit2_clar ]; then valgrind --leak-check=full --show-reachable=yes --suppressions=../libgit2_clar.supp ./libgit2_clar -ionline; else echo "Skipping valgrind"; fi
# Only watch the development branch
branches:
diff --git a/CMakeLists.txt b/CMakeLists.txt
index 7423652..ef49386 100644
--- a/CMakeLists.txt
+++ b/CMakeLists.txt
@@ -268,7 +268,7 @@ IF (BUILD_CLAR)
ENDIF ()
ENABLE_TESTING()
- ADD_TEST(libgit2_clar libgit2_clar)
+ ADD_TEST(libgit2_clar libgit2_clar -ionline)
ENDIF ()
IF (TAGS)
diff --git a/src/clone.c b/src/clone.c
index ff586a6..c2e724c 100644
--- a/src/clone.c
+++ b/src/clone.c
@@ -333,6 +333,7 @@ static int setup_remotes_and_fetch(
}
git_remote_disconnect(origin);
}
+ git_remote_free(origin);
}
return retcode;
diff --git a/src/reset.c b/src/reset.c
index f5daa8f..307e672 100644
--- a/src/reset.c
+++ b/src/reset.c
@@ -107,8 +107,7 @@ int git_reset(
if (reset_type > GIT_RESET_SOFT) {
/* reset index to the target content */
- if ((error = git_repository_index(&index, repo)) < 0 ||
- (error = git_index_read_tree(index, tree)) < 0 ||
+ if ((error = git_index_read_tree(index, tree)) < 0 ||
(error = git_index_write(index)) < 0)
goto cleanup;
diff --git a/tests-clar/checkout/tree.c b/tests-clar/checkout/tree.c
index 691f03d..3088758 100644
--- a/tests-clar/checkout/tree.c
+++ b/tests-clar/checkout/tree.c
@@ -67,6 +67,9 @@ void test_checkout_tree__can_checkout_and_remove_directory(void)
cl_assert_equal_i(true, git_path_isfile("./testrepo/ab/de/2.txt"));
cl_assert_equal_i(true, git_path_isfile("./testrepo/ab/de/fgh/1.txt"));
+ git_object_free(g_object);
+ g_object = NULL;
+
/* Checkout brach "master" and update HEAD, so that HEAD matches the
* current working tree
*/
@@ -136,6 +139,9 @@ void test_checkout_tree__doesnt_write_unrequested_files_to_worktree(void)
opts.checkout_strategy = GIT_CHECKOUT_NONE;
git_checkout_tree(g_repo, (git_object*)p_chomped_commit, &opts);
cl_assert_equal_i(false, git_path_isfile("testrepo/readme.txt"));
+
+ git_commit_free(p_master_commit);
+ git_commit_free(p_chomped_commit);
}
void test_checkout_tree__can_switch_branches(void)
diff --git a/tests-clar/clone/nonetwork.c b/tests-clar/clone/nonetwork.c
index b99c29d..9d22b73 100644
--- a/tests-clar/clone/nonetwork.c
+++ b/tests-clar/clone/nonetwork.c
@@ -144,6 +144,8 @@ void test_clone_nonetwork__custom_autotag(void)
cl_git_pass(git_tag_list(&tags, g_repo));
cl_assert_equal_i(0, tags.count);
+
+ git_strarray_free(&tags);
}
void test_clone_nonetwork__cope_with_already_existing_directory(void)
diff --git a/tests-clar/config/backend.c b/tests-clar/config/backend.c
index 65dbccc..28502a8 100644
--- a/tests-clar/config/backend.c
+++ b/tests-clar/config/backend.c
@@ -18,4 +18,6 @@ void test_config_backend__checks_version(void)
cl_git_fail(git_config_add_backend(cfg, &backend, 0, false));
err = giterr_last();
cl_assert_equal_i(GITERR_INVALID, err->klass);
+
+ git_config_free(cfg);
}