Git fork

t/helper: remove dependency on `the_repository` in "proc-receive"

The "proc-receive" test helper implicitly relies on `the_repository` via
`parse_oid_hex()`. This isn't necessary though, and in fact the whole
command does not depend on `the_repository` at all.

Stop setting up `the_repository` and use `parse_oid_hex_any()` to parse
object IDs.

Signed-off-by: Patrick Steinhardt <ps@pks.im>
Signed-off-by: Junio C Hamano <gitster@pobox.com>

authored by

Patrick Steinhardt and committed by
Junio C Hamano
912d4756 8e9a1d0d

+3 -6
+3 -6
t/helper/test-proc-receive.c
··· 3 3 #include "hex.h" 4 4 #include "parse-options.h" 5 5 #include "pkt-line.h" 6 - #include "setup.h" 7 6 #include "sigchain.h" 7 + #include "string-list.h" 8 8 9 9 static const char *proc_receive_usage[] = { 10 10 "test-tool proc-receive [<options>]", ··· 92 92 if (die_read_commands) 93 93 die("die with the --die-read-commands option"); 94 94 95 - if (parse_oid_hex(reader->line, &old_oid, &p) || 95 + if (parse_oid_hex_any(reader->line, &old_oid, &p) == GIT_HASH_UNKNOWN || 96 96 *p++ != ' ' || 97 - parse_oid_hex(p, &new_oid, &p) || 97 + parse_oid_hex_any(p, &new_oid, &p) == GIT_HASH_UNKNOWN || 98 98 *p++ != ' ') 99 99 die("protocol error: expected 'old new ref', got '%s'", 100 100 reader->line); ··· 128 128 129 129 int cmd__proc_receive(int argc, const char **argv) 130 130 { 131 - int nongit_ok = 0; 132 131 struct packet_reader reader; 133 132 struct command *commands = NULL; 134 133 struct string_list push_options = STRING_LIST_INIT_DUP; ··· 153 152 "use this protocol version number"), 154 153 OPT_END() 155 154 }; 156 - 157 - setup_git_directory_gently(&nongit_ok); 158 155 159 156 argc = parse_options(argc, argv, "test-tools", options, proc_receive_usage, 0); 160 157 if (argc > 0)