diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2014-11-17 14:28:22 +0100 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2014-11-17 14:28:22 +0100 |
commit | 5915d7001b0084356ece3f23c5e7c3f2be17e39c (patch) | |
tree | b649cbbe509c1de9d8c39691276a5f4f8d4786e4 /src/branch.c | |
parent | 8aa707376a4e9dc2b086569f3720901cfef83841 (diff) | |
download | libgit2-5915d7001b0084356ece3f23c5e7c3f2be17e39c.tar.gz |
branch: consider an empty upstream remote config as not found
Diffstat (limited to 'src/branch.c')
-rw-r--r-- | src/branch.c | 6 |
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: |