diff options
| author | Russell Belfer <rb@github.com> | 2014-03-25 09:14:48 -0700 |
|---|---|---|
| committer | Russell Belfer <rb@github.com> | 2014-03-25 09:14:48 -0700 |
| commit | a15c7802c86cf995fa658ef0624c46d352ce9a81 (patch) | |
| tree | 25bebc086059abc13e74a3a8b4e461c0cf06dc64 /tests/status/submodules.c | |
| parent | f210cb5b1442f82e2f930909d8430f7cc6661c5f (diff) | |
| download | libgit2-a15c7802c86cf995fa658ef0624c46d352ce9a81.tar.gz | |
Make submodules externally refcounted
`git_submodule` objects were already refcounted internally in case
the submodule name was different from the path at which it was
stored. This makes that refcounting externally used as well, so
`git_submodule_lookup` and `git_submodule_add_setup` return an
object that requires a `git_submodule_free` when done.
Diffstat (limited to 'tests/status/submodules.c')
| -rw-r--r-- | tests/status/submodules.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/tests/status/submodules.c b/tests/status/submodules.c index 80ff162fd..8575f9f2d 100644 --- a/tests/status/submodules.c +++ b/tests/status/submodules.c @@ -29,6 +29,7 @@ void test_status_submodules__api(void) cl_assert(sm != NULL); cl_assert_equal_s("testrepo", git_submodule_name(sm)); cl_assert_equal_s("testrepo", git_submodule_path(sm)); + git_submodule_free(sm); } void test_status_submodules__0(void) @@ -136,6 +137,7 @@ void test_status_submodules__moved_head(void) cl_git_pass(git_submodule_lookup(&sm, g_repo, "testrepo")); cl_git_pass(git_submodule_open(&smrepo, sm)); + git_submodule_free(sm); /* move submodule HEAD to c47800c7266a2be04c571c04d5a6614691ea99bd */ cl_git_pass( |
