summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
Diffstat (limited to 'src')
-rw-r--r--src/hash.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/src/hash.c b/src/hash.c
index 405c46a9a..963c28137 100644
--- a/src/hash.c
+++ b/src/hash.c
@@ -31,7 +31,7 @@ void git_hash_ctx_cleanup(git_hash_ctx *ctx)
git_hash_sha1_ctx_cleanup(&ctx->sha1);
return;
default:
- assert(0);
+ /* unreachable */ ;
}
}
@@ -41,8 +41,7 @@ int git_hash_init(git_hash_ctx *ctx)
case GIT_HASH_ALGO_SHA1:
return git_hash_sha1_init(&ctx->sha1);
default:
- assert(0);
- return -1;
+ GIT_ASSERT(0);
}
}
@@ -52,8 +51,7 @@ int git_hash_update(git_hash_ctx *ctx, const void *data, size_t len)
case GIT_HASH_ALGO_SHA1:
return git_hash_sha1_update(&ctx->sha1, data, len);
default:
- assert(0);
- return -1;
+ GIT_ASSERT(0);
}
}
@@ -63,8 +61,7 @@ int git_hash_final(git_oid *out, git_hash_ctx *ctx)
case GIT_HASH_ALGO_SHA1:
return git_hash_sha1_final(out, &ctx->sha1);
default:
- assert(0);
- return -1;
+ GIT_ASSERT(0);
}
}
@@ -80,7 +77,7 @@ int git_hash_buf(git_oid *out, const void *data, size_t len)
error = git_hash_final(out, &ctx);
git_hash_ctx_cleanup(&ctx);
-
+
return error;
}