summaryrefslogtreecommitdiffstats
path: root/hex.c
diff options
context:
space:
mode:
Diffstat (limited to 'hex.c')
-rw-r--r--hex.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/hex.c b/hex.c
index d42262bdca..5ca78a7744 100644
--- a/hex.c
+++ b/hex.c
@@ -1,3 +1,5 @@
+#define USE_THE_REPOSITORY_VARIABLE
+
#include "git-compat-util.h"
#include "hash.h"
#include "hex.h"
@@ -25,8 +27,12 @@ int get_oid_hex_algop(const char *hex, struct object_id *oid,
const struct git_hash_algo *algop)
{
int ret = get_hash_hex_algop(hex, oid->hash, algop);
- if (!ret)
+ if (!ret) {
oid_set_algo(oid, algop);
+ if (algop->rawsz != GIT_MAX_RAWSZ)
+ memset(oid->hash + algop->rawsz, 0,
+ GIT_MAX_RAWSZ - algop->rawsz);
+ }
return ret;
}