summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2019-08-18 20:04:11 (GMT)
committerJunio C Hamano <gitster@pobox.com>2019-08-19 22:04:58 (GMT)
commit703d2d4193738526d7b4116657657101e49a601e (patch)
tree21346325ae997eed9924e917ec3bc5b6f5f183e8
parent9d958cc0417ce2c8a4504ac8dd140685445ce4d7 (diff)
downloadgit-703d2d4193738526d7b4116657657101e49a601e.zip
git-703d2d4193738526d7b4116657657101e49a601e.tar.gz
git-703d2d4193738526d7b4116657657101e49a601e.tar.bz2
bundle: switch to use the_hash_algo
Switch a use of the constant 40 and a use of GIT_SHA1_HEXSZ to use the_hash_algo instead. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
-rw-r--r--bundle.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/bundle.c b/bundle.c
index b5d21cd..a85ed3f 100644
--- a/bundle.c
+++ b/bundle.c
@@ -282,7 +282,7 @@ static int write_pack_data(int bundle_fd, struct rev_info *revs)
struct object *object = revs->pending.objects[i].item;
if (object->flags & UNINTERESTING)
write_or_die(pack_objects.in, "^", 1);
- write_or_die(pack_objects.in, oid_to_hex(&object->oid), GIT_SHA1_HEXSZ);
+ write_or_die(pack_objects.in, oid_to_hex(&object->oid), the_hash_algo->hexsz);
write_or_die(pack_objects.in, "\n", 1);
}
close(pack_objects.in);
@@ -414,7 +414,7 @@ static int write_bundle_refs(int bundle_fd, struct rev_info *revs)
}
ref_count++;
- write_or_die(bundle_fd, oid_to_hex(&e->item->oid), 40);
+ write_or_die(bundle_fd, oid_to_hex(&e->item->oid), the_hash_algo->hexsz);
write_or_die(bundle_fd, " ", 1);
write_or_die(bundle_fd, display_ref, strlen(display_ref));
write_or_die(bundle_fd, "\n", 1);