Unverified Commit dea5ce3d by Edward Thomson Committed by GitHub

Merge pull request #5359 from tniessen/make-type-mismatch-errors-consistent

Make type mismatch errors consistent
parents cc4f4cbe 5e1b6eaf
...@@ -753,7 +753,7 @@ int git_commit_extract_signature(git_buf *signature, git_buf *signed_data, git_r ...@@ -753,7 +753,7 @@ int git_commit_extract_signature(git_buf *signature, git_buf *signed_data, git_r
return error; return error;
if (obj->cached.type != GIT_OBJECT_COMMIT) { if (obj->cached.type != GIT_OBJECT_COMMIT) {
git_error_set(GIT_ERROR_INVALID, "the requested type does not match the type in ODB"); git_error_set(GIT_ERROR_INVALID, "the requested type does not match the type in the ODB");
error = GIT_ENOTFOUND; error = GIT_ENOTFOUND;
goto cleanup; goto cleanup;
} }
......
...@@ -201,7 +201,7 @@ int git_object_lookup_prefix( ...@@ -201,7 +201,7 @@ int git_object_lookup_prefix(
if (type != GIT_OBJECT_ANY && type != object->cached.type) { if (type != GIT_OBJECT_ANY && type != object->cached.type) {
git_object_free(object); git_object_free(object);
git_error_set(GIT_ERROR_INVALID, git_error_set(GIT_ERROR_INVALID,
"the requested type does not match the type in ODB"); "the requested type does not match the type in the ODB");
return GIT_ENOTFOUND; return GIT_ENOTFOUND;
} }
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment