Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

FIX: odb keys did not store the correct key identifier in redis - (Th… #17

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions redis/hiredis.c
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ int hiredis_odb_backend__read_header(size_t *len_p, git_otype *type_p, git_odb_b
backend = (hiredis_odb_backend *) _backend;
error = GIT_ERROR;

git_oid_tostr(str_id, GIT_OID_HEXSZ, oid);
git_oid_tostr(str_id, GIT_OID_HEXSZ + 1, oid);

reply = redisCommand(backend->db, "HMGET %s:%s:odb:%s %s %s", backend->prefix, backend->repo_path, str_id, "type", "size");

Expand Down Expand Up @@ -108,7 +108,7 @@ int hiredis_odb_backend__read(void **data_p, size_t *len_p, git_otype *type_p, g
backend = (hiredis_odb_backend *) _backend;
error = GIT_ERROR;

git_oid_tostr(str_id, GIT_OID_HEXSZ, oid);
git_oid_tostr(str_id, GIT_OID_HEXSZ + 1, oid);

reply = redisCommand(backend->db, "HMGET %s:%s:odb:%s %s %s %s", backend->prefix, backend->repo_path, str_id,
"type", "size", "data");
Expand Down Expand Up @@ -170,7 +170,7 @@ int hiredis_odb_backend__exists(git_odb_backend *_backend, const git_oid *oid)
backend = (hiredis_odb_backend *) _backend;
found = 0;

git_oid_tostr(str_id, GIT_OID_HEXSZ, oid);
git_oid_tostr(str_id, GIT_OID_HEXSZ + 1, oid);

reply = redisCommand(backend->db, "exists %s:%s:odb:%s", backend->prefix, backend->repo_path, str_id);
if (reply->type == REDIS_REPLY_INTEGER)
Expand All @@ -193,7 +193,7 @@ int hiredis_odb_backend__write(git_odb_backend *_backend, const git_oid *oid, co
backend = (hiredis_odb_backend *) _backend;
error = GIT_ERROR;

git_oid_tostr(str_id, GIT_OID_HEXSZ, oid);
git_oid_tostr(str_id, GIT_OID_HEXSZ + 1, oid);

reply = redisCommand(backend->db, "HMSET %s:%s:odb:%s "
"type %d "
Expand Down