Commit ecc2ffda by Edward Thomson

midx: avoid assignment in assert

`GIT_ASSERT` may be a macro for `assert` (when `GIT_ASSERT_HARD` is
defined), which may differ in debug builds. Pull the assignment out of
the assertion.
parent bc040875
......@@ -703,9 +703,9 @@ static int midx_write(
hash_cb_data.ctx = &ctx;
oid_size = git_oid_size(w->oid_type);
GIT_ASSERT((checksum_type = git_oid_algorithm(w->oid_type)));
checksum_type = git_oid_algorithm(w->oid_type);
checksum_size = git_hash_size(checksum_type);
GIT_ASSERT(oid_size && checksum_type && checksum_size);
if ((error = git_hash_ctx_init(&ctx, checksum_type)) < 0)
return error;
......
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