diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2016-04-11 17:43:07 +0200 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2016-04-11 17:47:03 +0200 |
commit | 77965c685d0ca8d5dc65ba3aedb41cca5485ae04 (patch) | |
tree | ccc58957841e7df6c4e7b3f1ccb98e8874173038 /src/refs.c | |
parent | 69723dd8d3b40f1e508d82ed0339839051abd19a (diff) | |
download | libgit2-77965c685d0ca8d5dc65ba3aedb41cca5485ae04.tar.gz |
refs: provide a more general error message for dwimcmn/dwim-general-message
If we cannot dwim the input, set the error message to be explicit about
that. Otherwise we leave the error for the last failed lookup, which
can be rather unexpected as it mentions a remote when the user thought
they were trying to look up a branch.
Diffstat (limited to 'src/refs.c')
-rw-r--r-- | src/refs.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/src/refs.c b/src/refs.c index a15e31b53..26c80021f 100644 --- a/src/refs.c +++ b/src/refs.c @@ -289,6 +289,9 @@ cleanup: "Could not use '%s' as valid reference name", git_buf_cstr(&name)); } + if (error == GIT_ENOTFOUND) + giterr_set(GITERR_REFERENCE, "no reference found for shorthand '%s'", refname); + git_buf_free(&name); git_buf_free(&refnamebuf); return error; |