summaryrefslogtreecommitdiff
path: root/tests/refs
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2021-07-30 08:56:51 -0400
committerEdward Thomson <ethomson@edwardthomson.com>2021-07-30 08:56:51 -0400
commitcc68c19a3a6f025d94e332e856f43ab438dfbf08 (patch)
tree3224a0ba8e3c783418722829be97ad297e5d263a /tests/refs
parent47dd9f47972f0885b288a950714568c98f16a79e (diff)
parentf2915ec488898efe956c90c322fff67d0030f92f (diff)
downloadlibgit2-cc68c19a3a6f025d94e332e856f43ab438dfbf08.tar.gz
Merge branch 'pr/5861'
Diffstat (limited to 'tests/refs')
-rw-r--r--tests/refs/branches/upstream.c23
1 files changed, 23 insertions, 0 deletions
diff --git a/tests/refs/branches/upstream.c b/tests/refs/branches/upstream.c
index 928a9ff7b..c94afe9e8 100644
--- a/tests/refs/branches/upstream.c
+++ b/tests/refs/branches/upstream.c
@@ -71,6 +71,29 @@ void test_refs_branches_upstream__upstream_remote(void)
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)
{
git_repository *repository;