summaryrefslogtreecommitdiff
path: root/src/revwalk.c
diff options
context:
space:
mode:
authorCarlos Martín Nieto <cmn@dwim.me>2014-11-19 18:42:29 +0100
committerCarlos Martín Nieto <cmn@dwim.me>2014-11-22 18:55:22 +0100
commit753e17b0f518c2510848a9dd73cc45e4c6df1a8a (patch)
tree39b27d69fa709024ba8b786c04bc66264d9cd97b /src/revwalk.c
parent4d86caec599ab760b523a026040bc4f40f8338c9 (diff)
downloadlibgit2-cmn/peeling-errors.tar.gz
peel: reject bad queries with EINVALIDSPECcmn/peeling-errors
There are some combination of objects and target types which we know cannot be fulfilled. Return EINVALIDSPEC for those to signify that there is a mismatch in the user-provided data and what the object model is capable of satisfying. If we start at a tag and in the course of peeling find out that we cannot reach a particular type, we return EPEEL.
Diffstat (limited to 'src/revwalk.c')
-rw-r--r--src/revwalk.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/revwalk.c b/src/revwalk.c
index 4dca7599a..e44385d48 100644
--- a/src/revwalk.c
+++ b/src/revwalk.c
@@ -124,7 +124,7 @@ static int push_commit(git_revwalk *walk, const git_oid *oid, int uninteresting,
error = git_object_peel(&obj, oobj, GIT_OBJ_COMMIT);
git_object_free(oobj);
- if (error == GIT_ENOTFOUND) {
+ if (error == GIT_ENOTFOUND || error == GIT_EINVALIDSPEC || error == GIT_EPEEL) {
/* If this comes from e.g. push_glob("tags"), ignore this */
if (from_glob)
return 0;