diff options
| author | Junio C Hamano <gitster@pobox.com> | 2017-11-09 14:31:27 +0900 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2017-11-09 14:31:27 +0900 |
| commit | bde13700105a1c945819578ce8d5c0627d52c741 (patch) | |
| tree | f099ae14f511cb3461a0f7e8361bb85b4679506e /http-push.c | |
| parent | b169d187682ed3f928df7806b00f3a62b83edfef (diff) | |
| parent | 62a24c8923274b0ef941b2e7bc6efdb2fd52e6bf (diff) | |
| download | git-bde13700105a1c945819578ce8d5c0627d52c741.tar.gz | |
Merge branch 'rs/hex-to-bytes-cleanup'
Code cleanup.
* rs/hex-to-bytes-cleanup:
sha1_file: use hex_to_bytes()
http-push: use hex_to_bytes()
notes: move hex_to_bytes() to hex.c and export it
Diffstat (limited to 'http-push.c')
| -rw-r--r-- | http-push.c | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/http-push.c b/http-push.c index 493ee7d719..14435ab65d 100644 --- a/http-push.c +++ b/http-push.c @@ -1007,20 +1007,18 @@ static void remote_ls(const char *path, int flags, void (*userFunc)(struct remote_ls_ctx *ls), void *userData); -/* extract hex from sharded "xx/x{40}" filename */ +/* extract hex from sharded "xx/x{38}" filename */ static int get_oid_hex_from_objpath(const char *path, struct object_id *oid) { - char hex[GIT_MAX_HEXSZ]; - if (strlen(path) != GIT_SHA1_HEXSZ + 1) return -1; - memcpy(hex, path, 2); + if (hex_to_bytes(oid->hash, path, 1)) + return -1; path += 2; path++; /* skip '/' */ - memcpy(hex + 2, path, GIT_SHA1_HEXSZ - 2); - return get_oid_hex(hex, oid); + return hex_to_bytes(oid->hash + 1, path, GIT_SHA1_RAWSZ - 1); } static void process_ls_object(struct remote_ls_ctx *ls) |
