Welcome to mirror list, hosted at ThFree Co, Russian Federation.

git.kernel.org/pub/scm/git/git.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/t
diff options
context:
space:
mode:
authorbrian m. carlson <sandals@crustytoothpaste.net>2017-03-26 19:01:32 +0300
committerJunio C Hamano <gitster@pobox.com>2017-03-28 19:59:33 +0300
commit57836f10ad47c2b2c3b94502024758871841091f (patch)
tree4da68a3f2bda8899cdfa776d5adba35cf016f851 /t
parent9e1d7087dcf0f6e7056f4536c3c750cf6cfe37a4 (diff)
test-sha1-array: convert most code to struct object_id
This helper is very small, so convert the entire thing. Signed-off-by: brian m. carlson <sandals@crustytoothpaste.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't')
-rw-r--r--t/helper/test-sha1-array.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/t/helper/test-sha1-array.c b/t/helper/test-sha1-array.c
index f7a53c4ad6..b4bb97fccc 100644
--- a/t/helper/test-sha1-array.c
+++ b/t/helper/test-sha1-array.c
@@ -14,16 +14,16 @@ int cmd_main(int argc, const char **argv)
while (strbuf_getline(&line, stdin) != EOF) {
const char *arg;
- unsigned char sha1[20];
+ struct object_id oid;
if (skip_prefix(line.buf, "append ", &arg)) {
- if (get_sha1_hex(arg, sha1))
+ if (get_oid_hex(arg, &oid))
die("not a hexadecimal SHA1: %s", arg);
- sha1_array_append(&array, sha1);
+ sha1_array_append(&array, oid.hash);
} else if (skip_prefix(line.buf, "lookup ", &arg)) {
- if (get_sha1_hex(arg, sha1))
+ if (get_oid_hex(arg, &oid))
die("not a hexadecimal SHA1: %s", arg);
- printf("%d\n", sha1_array_lookup(&array, sha1));
+ printf("%d\n", sha1_array_lookup(&array, oid.hash));
} else if (!strcmp(line.buf, "clear"))
sha1_array_clear(&array);
else if (!strcmp(line.buf, "for_each_unique"))