summaryrefslogtreecommitdiff
path: root/split-index.c
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2018-05-02 00:25:43 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-05-02 04:59:50 (GMT)
commit2182abd94bf69a8daba18e71efae3e9f02a6c465 (patch)
tree23d79183a42224fc33bab5530b7f795d24f0001a /split-index.c
parent34caab0261d87b230520f97f2d1ce9ca4474dc73 (diff)
downloadgit-2182abd94bf69a8daba18e71efae3e9f02a6c465.zip
git-2182abd94bf69a8daba18e71efae3e9f02a6c465.tar.gz
git-2182abd94bf69a8daba18e71efae3e9f02a6c465.tar.bz2
split-index: convert struct split_index to object_id
Convert the base_sha1 member of struct split_index to use struct object_id and rename it base_oid. Include cache.h to make the structure visible. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'split-index.c')
-rw-r--r--split-index.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/split-index.c b/split-index.c
index 3eb8ff1..660c75f 100644
--- a/split-index.c
+++ b/split-index.c
@@ -18,12 +18,12 @@ int read_link_extension(struct index_state *istate,
struct split_index *si;
int ret;
- if (sz < 20)
+ if (sz < the_hash_algo->rawsz)
return error("corrupt link extension (too short)");
si = init_split_index(istate);
- hashcpy(si->base_sha1, data);
- data += 20;
- sz -= 20;
+ hashcpy(si->base_oid.hash, data);
+ data += the_hash_algo->rawsz;
+ sz -= the_hash_algo->rawsz;
if (!sz)
return 0;
si->delete_bitmap = ewah_new();
@@ -45,7 +45,7 @@ int write_link_extension(struct strbuf *sb,
struct index_state *istate)
{
struct split_index *si = istate->split_index;
- strbuf_add(sb, si->base_sha1, 20);
+ strbuf_add(sb, si->base_oid.hash, the_hash_algo->rawsz);
if (!si->delete_bitmap && !si->replace_bitmap)
return 0;
ewah_serialize_strbuf(si->delete_bitmap, sb);