summaryrefslogtreecommitdiff
path: root/src/branch.c
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 /src/branch.c
parent8aa707376a4e9dc2b086569f3720901cfef83841 (diff)
downloadlibgit2-5915d7001b0084356ece3f23c5e7c3f2be17e39c.tar.gz
branch: consider an empty upstream remote config as not found
Diffstat (limited to 'src/branch.c')
-rw-r--r--src/branch.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/branch.c b/src/branch.c
index 01402a2e9..b4e4b0564 100644
--- a/src/branch.c
+++ b/src/branch.c
@@ -400,6 +400,12 @@ int git_branch_upstream_remote(git_buf *buf, git_repository *repo, const char *r
if ((error = retrieve_upstream_configuration(&str, cfg, refname, "branch.%s.remote")) < 0)
goto cleanup;
+ if (!*str) {
+ giterr_set(GITERR_REFERENCE, "branch '%s' does not have an upstream remote", refname);
+ error = GIT_ENOTFOUND;
+ goto cleanup;
+ }
+
error = git_buf_puts(buf, str);
cleanup: