summaryrefslogtreecommitdiff
path: root/tests
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2014-11-17 14:28:22 +0100
committerCarlos Martín Nieto <cmn@dwim.me>2014-11-17 14:28:22 +0100
commit5915d7001b0084356ece3f23c5e7c3f2be17e39c (patch)
treeb649cbbe509c1de9d8c39691276a5f4f8d4786e4 /tests
parent8aa707376a4e9dc2b086569f3720901cfef83841 (diff)
downloadlibgit2-5915d7001b0084356ece3f23c5e7c3f2be17e39c.tar.gz
branch: consider an empty upstream remote config as not found
Diffstat (limited to 'tests')
-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;