summaryrefslogtreecommitdiff
path: root/src/cli
diff options
context:
space:
mode:
authorEdward Thomson <ethomson@edwardthomson.com>2022-01-26 13:07:28 -0500
committerEdward Thomson <ethomson@edwardthomson.com>2022-06-20 17:05:29 -0400
commit8444b6dce71d53a44f300d7c023cdd075faaa872 (patch)
tree2d3fbe6f5120ba8cb54cc460d34f76489fdce2cb /src/cli
parentc50b280fa5bf525c6f84c39826a28ea9360e9136 (diff)
downloadlibgit2-8444b6dce71d53a44f300d7c023cdd075faaa872.tar.gz
odb_hash*: accept the oid type to hash into
The git_odb_hash helper functions should not assume SHA1, and instead should be given the oid type that they're producing.
Diffstat (limited to 'src/cli')
-rw-r--r--src/cli/cmd_hash_object.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/src/cli/cmd_hash_object.c b/src/cli/cmd_hash_object.c
index 5cfe9146a..72fbef9e6 100644
--- a/src/cli/cmd_hash_object.c
+++ b/src/cli/cmd_hash_object.c
@@ -64,7 +64,7 @@ static int hash_buf(git_odb *odb, git_str *buf, git_object_t type)
if (git_odb_write(&oid, odb, buf->ptr, buf->size, type) < 0)
return cli_error_git();
} else {
- if (git_odb_hash(&oid, buf->ptr, buf->size, type) < 0)
+ if (git_odb_hash(&oid, buf->ptr, buf->size, type, GIT_OID_SHA1) < 0)
return cli_error_git();
}