Commit 55f2abb8 by Dmitry Lobanov

tests: upstream merge test has been added.

parent 94571908
...@@ -71,6 +71,29 @@ void test_refs_branches_upstream__upstream_remote(void) ...@@ -71,6 +71,29 @@ void test_refs_branches_upstream__upstream_remote(void)
git_buf_dispose(&buf); git_buf_dispose(&buf);
} }
void test_refs_branches_upstream__upstream_merge(void)
{
git_reference *branch;
git_repository *repository;
git_buf buf = GIT_BUF_INIT;
repository = cl_git_sandbox_init("testrepo.git");
/* check repository */
cl_git_pass(git_reference_lookup(&branch, repository, "refs/heads/test"));
cl_git_pass(git_branch_set_upstream(branch, "test/master"));
assert_config_entry_value(repository, "branch.test.remote", "test");
assert_config_entry_value(repository, "branch.test.merge", "refs/heads/master");
git_reference_free(branch);
/* check merge branch */
cl_git_pass(git_branch_upstream_merge(&buf, repository, "refs/heads/test"));
cl_assert_equal_s("refs/heads/master", buf.ptr);
git_buf_dispose(&buf);
}
void test_refs_branches_upstream__upstream_remote_empty_value(void) void test_refs_branches_upstream__upstream_remote_empty_value(void)
{ {
git_repository *repository; git_repository *repository;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment