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.c16
1 files changed, 16 insertions, 0 deletions
diff --git a/tests/refs/branches/upstream.c b/tests/refs/branches/upstream.c
index abf7933d3..b20b93753 100644
--- a/tests/refs/branches/upstream.c
+++ b/tests/refs/branches/upstream.c
@@ -70,6 +70,22 @@ void test_refs_branches_upstream__upstream_remote(void)
git_buf_free(&buf);
}
+void test_refs_branches_upstream__upstream_remote_empty_value(void)
+{
+ git_repository *repository;
+ git_config *cfg;
+ git_buf buf = GIT_BUF_INIT;
+
+ repository = cl_git_sandbox_init("testrepo.git");
+ cl_git_pass(git_repository_config(&cfg, repository));
+ cl_git_pass(git_config_set_string(cfg, "branch.master.remote", ""));
+ cl_git_fail_with(GIT_ENOTFOUND, git_branch_upstream_remote(&buf, repository, "refs/heads/master"));
+
+ cl_git_pass(git_config_delete_entry(cfg, "branch.master.remote"));
+ cl_git_fail_with(GIT_ENOTFOUND, git_branch_upstream_remote(&buf, repository, "refs/heads/master"));
+ cl_git_sandbox_cleanup();
+}
+
static void assert_merge_and_or_remote_key_missing(git_repository *repository, const git_commit *target, const char *entry_name)
{
git_reference *branch;