summaryrefslogtreecommitdiff
path: root/tests/reset
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2014-03-05 20:28:49 +0100
committerCarlos Martín Nieto <cmn@dwim.me>2014-03-07 16:03:15 +0100
commitae32c54e5806cf8517beeb057cf640ed346508eb (patch)
tree7ac45d3d7598966459e5fcb57e05fe790564cef5 /tests/reset
parenta07b169834a11f60a2baa98f9735c2dfe7e4a1ee (diff)
downloadlibgit2-ae32c54e5806cf8517beeb057cf640ed346508eb.tar.gz
Plug a few leaks in the tests
Diffstat (limited to 'tests/reset')
-rw-r--r--tests/reset/hard.c4
-rw-r--r--tests/reset/mixed.c6
2 files changed, 10 insertions, 0 deletions
diff --git a/tests/reset/hard.c b/tests/reset/hard.c
index d4c7db45f..36120ee63 100644
--- a/tests/reset/hard.c
+++ b/tests/reset/hard.c
@@ -212,12 +212,16 @@ void test_reset_hard__reflog_is_correct(void)
reflog_check(repo, "HEAD", 3, "emeric.fermas@gmail.com", exp_msg);
reflog_check(repo, "refs/heads/master", 3, "emeric.fermas@gmail.com", exp_msg);
+ git_object_free(target);
+
/* Moved branch, expect default message */
cl_git_pass(git_revparse_single(&target, repo, "HEAD~^{commit}"));
cl_git_pass(git_reset(repo, target, GIT_RESET_HARD, NULL, NULL));
reflog_check(repo, "HEAD", 3, "emeric.fermas@gmail.com", exp_msg);
reflog_check(repo, "refs/heads/master", 4, NULL, "reset: moving");
+ git_object_free(target);
+
/* Moved branch, expect custom message */
cl_git_pass(git_revparse_single(&target, repo, "HEAD~^{commit}"));
cl_git_pass(git_reset(repo, target, GIT_RESET_HARD, NULL, "message1"));
diff --git a/tests/reset/mixed.c b/tests/reset/mixed.c
index 25272a75c..5d8ff63b4 100644
--- a/tests/reset/mixed.c
+++ b/tests/reset/mixed.c
@@ -61,12 +61,18 @@ void test_reset_mixed__reflog_is_correct(void)
reflog_check(repo, "HEAD", 9, "yoram.harmelin@gmail.com", exp_msg);
reflog_check(repo, "refs/heads/master", 9, "yoram.harmelin@gmail.com", exp_msg);
+ git_object_free(target);
+ target = NULL;
+
/* Moved branch, expect default message */
cl_git_pass(git_revparse_single(&target, repo, "HEAD~^{commit}"));
cl_git_pass(git_reset(repo, target, GIT_RESET_MIXED, NULL, NULL));
reflog_check(repo, "HEAD", 9, "yoram.harmelin@gmail.com", exp_msg);
reflog_check(repo, "refs/heads/master", 10, NULL, "reset: moving");
+ git_object_free(target);
+ target = NULL;
+
/* Moved branch, expect custom message */
cl_git_pass(git_revparse_single(&target, repo, "HEAD~^{commit}"));
cl_git_pass(git_reset(repo, target, GIT_RESET_MIXED, NULL, "message1"));