summaryrefslogtreecommitdiff
path: root/tests/refs/branches/upstream.c
diff options
context:
space:
mode:
Diffstat (limited to 'tests/refs/branches/upstream.c')
-rw-r--r--tests/refs/branches/upstream.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/tests/refs/branches/upstream.c b/tests/refs/branches/upstream.c
index ce3569813..b09a1c3fb 100644
--- a/tests/refs/branches/upstream.c
+++ b/tests/refs/branches/upstream.c
@@ -113,26 +113,33 @@ void test_refs_branches_upstream__set_unset_upstream(void)
cl_git_pass(git_config_get_string(&value, config, "branch.test.merge"));
cl_assert_equal_s(value, "refs/heads/master");
+ git_config_free(config);
git_reference_free(branch);
/* local */
cl_git_pass(git_reference_lookup(&branch, repository, "refs/heads/test"));
cl_git_pass(git_branch_set_upstream(branch, "master"));
+ cl_git_pass(git_repository_config(&config, repository));
cl_git_pass(git_config_get_string(&value, config, "branch.test.remote"));
cl_assert_equal_s(value, ".");
cl_git_pass(git_config_get_string(&value, config, "branch.test.merge"));
cl_assert_equal_s(value, "refs/heads/master");
+ git_config_free(config);
/* unset */
cl_git_pass(git_branch_set_upstream(branch, NULL));
+ cl_git_pass(git_repository_config(&config, repository));
cl_git_fail_with(git_config_get_string(&value, config, "branch.test.merge"), GIT_ENOTFOUND);
cl_git_fail_with(git_config_get_string(&value, config, "branch.test.remote"), GIT_ENOTFOUND);
+ git_config_free(config);
git_reference_free(branch);
cl_git_pass(git_reference_lookup(&branch, repository, "refs/heads/master"));
cl_git_pass(git_branch_set_upstream(branch, NULL));
+
+ cl_git_pass(git_repository_config(&config, repository));
cl_git_fail_with(git_config_get_string(&value, config, "branch.master.merge"), GIT_ENOTFOUND);
cl_git_fail_with(git_config_get_string(&value, config, "branch.master.remote"), GIT_ENOTFOUND);