diff options
author | Carlos Martín Nieto <cmn@dwim.me> | 2014-11-19 18:42:29 +0100 |
---|---|---|
committer | Carlos Martín Nieto <cmn@dwim.me> | 2014-11-22 18:55:22 +0100 |
commit | 753e17b0f518c2510848a9dd73cc45e4c6df1a8a (patch) | |
tree | 39b27d69fa709024ba8b786c04bc66264d9cd97b /tests/refs/revparse.c | |
parent | 4d86caec599ab760b523a026040bc4f40f8338c9 (diff) | |
download | libgit2-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 'tests/refs/revparse.c')
-rw-r--r-- | tests/refs/revparse.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/tests/refs/revparse.c b/tests/refs/revparse.c index a540f389d..94e55bda4 100644 --- a/tests/refs/revparse.c +++ b/tests/refs/revparse.c @@ -24,11 +24,11 @@ static void test_object_and_ref_inrepo( error = git_revparse_ext(&obj, &ref, repo, spec); if (expected_oid != NULL) { - cl_assert_equal_i(0, error); + cl_git_pass(error); git_oid_fmt(objstr, git_object_id(obj)); cl_assert_equal_s(objstr, expected_oid); } else - cl_assert_equal_i(GIT_ENOTFOUND, error); + cl_git_fail(error); if (assert_reference_retrieval) { if (expected_refname == NULL) @@ -222,7 +222,7 @@ void test_refs_revparse__to_type(void) assert_invalid_single_spec("wrapped_tag^{trip}"); test_object("point_to_blob^{commit}", NULL); cl_assert_equal_i( - GIT_EAMBIGUOUS, git_revparse_single(&g_obj, g_repo, "wrapped_tag^{blob}")); + GIT_EPEEL, git_revparse_single(&g_obj, g_repo, "wrapped_tag^{blob}")); test_object("wrapped_tag^{commit}", "a65fedf39aefe402d3bb6e24df4d4f5fe4547750"); test_object("wrapped_tag^{tree}", "944c0f6e4dfa41595e6eb3ceecdb14f50fe18162"); |