Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
test-sha1-array: convert most code to struct object_id
author
brian m. carlson
<sandals@crustytoothpaste.net>
Sun, 26 Mar 2017 16:01:32 +0000
(16:01 +0000)
committer
Junio C Hamano
<gitster@pobox.com>
Tue, 28 Mar 2017 16:59:33 +0000
(09:59 -0700)
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>
t/helper/test-sha1-array.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
9e1d708
)
diff --git
a/t/helper/test-sha1-array.c
b/t/helper/test-sha1-array.c
index f7a53c4ad64c18903f53c5bd1d4766f54bc22e49..b4bb97fcccc28ab0e2b2949992a52e00878b254d 100644
(file)
--- 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;
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 (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);
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)) {
} 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);
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"))
} else if (!strcmp(line.buf, "clear"))
sha1_array_clear(&array);
else if (!strcmp(line.buf, "for_each_unique"))