diff options
Diffstat (limited to 't/helper/test-oid-array.c')
| -rw-r--r-- | t/helper/test-oid-array.c | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/t/helper/test-oid-array.c b/t/helper/test-oid-array.c index d1324d086a..076b849cbf 100644 --- a/t/helper/test-oid-array.c +++ b/t/helper/test-oid-array.c @@ -1,20 +1,26 @@ +#define USE_THE_REPOSITORY_VARIABLE + #include "test-tool.h" -#include "cache.h" +#include "hex.h" #include "oid-array.h" +#include "setup.h" +#include "strbuf.h" -static int print_oid(const struct object_id *oid, void *data) +static int print_oid(const struct object_id *oid, void *data UNUSED) { puts(oid_to_hex(oid)); return 0; } -int cmd__oid_array(int argc, const char **argv) +int cmd__oid_array(int argc UNUSED, const char **argv UNUSED) { struct oid_array array = OID_ARRAY_INIT; struct strbuf line = STRBUF_INIT; int nongit_ok; setup_git_directory_gently(&nongit_ok); + if (nongit_ok) + repo_set_hash_algo(the_repository, GIT_HASH_SHA1); while (strbuf_getline(&line, stdin) != EOF) { const char *arg; |
