Commit 0cce210a by Russell Belfer

Use assert for peel target type check

parent b60d95c7
......@@ -318,16 +318,11 @@ int git_object_peel(
if (git_object_type(object) == target_type)
return git_object_dup(peeled, (git_object *)object);
if (target_type != GIT_OBJ_TAG &&
target_type != GIT_OBJ_COMMIT &&
target_type != GIT_OBJ_TREE &&
target_type != GIT_OBJ_BLOB &&
target_type != GIT_OBJ_ANY) {
giterr_set(GITERR_OBJECT, "Cannot peel to object type %d",
(int)target_type);
return GIT_EINVALIDSPEC;
}
assert(target_type == GIT_OBJ_TAG ||
target_type == GIT_OBJ_COMMIT ||
target_type == GIT_OBJ_TREE ||
target_type == GIT_OBJ_BLOB ||
target_type == GIT_OBJ_ANY);
source = (git_object *)object;
......
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