upload-pack: remove packet debugging harness
If you set the GIT_DEBUG_SEND_PACK environment variable, upload-pack will dump lines it receives in the receive_needs phase to a descriptor. This debugging harness is a strict subset of what GIT_TRACE_PACKET can do. Let's just drop it in favor of that. A few tests used GIT_DEBUG_SEND_PACK to confirm which objects get sent; we have to adapt them to the new output format. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:

committed by
Junio C Hamano

parent
e58e57e49e
commit
97a83fa839
@ -42,7 +42,6 @@ static unsigned int timeout;
|
||||
* otherwise maximum packet size (up to 65520 bytes).
|
||||
*/
|
||||
static int use_sideband;
|
||||
static int debug_fd;
|
||||
static int advertise_refs;
|
||||
static int stateless_rpc;
|
||||
|
||||
@ -580,8 +579,6 @@ static void receive_needs(void)
|
||||
int has_non_tip = 0;
|
||||
|
||||
shallow_nr = 0;
|
||||
if (debug_fd)
|
||||
write_str_in_full(debug_fd, "#S\n");
|
||||
for (;;) {
|
||||
struct object *o;
|
||||
const char *features;
|
||||
@ -590,8 +587,6 @@ static void receive_needs(void)
|
||||
reset_timeout();
|
||||
if (!len)
|
||||
break;
|
||||
if (debug_fd)
|
||||
write_in_full(debug_fd, line, len);
|
||||
|
||||
if (!prefixcmp(line, "shallow ")) {
|
||||
unsigned char sha1[20];
|
||||
@ -653,8 +648,6 @@ static void receive_needs(void)
|
||||
add_object_array(o, NULL, &want_obj);
|
||||
}
|
||||
}
|
||||
if (debug_fd)
|
||||
write_str_in_full(debug_fd, "#E\n");
|
||||
|
||||
/*
|
||||
* We have sent all our refs already, and the other end
|
||||
@ -845,8 +838,6 @@ int main(int argc, char **argv)
|
||||
if (is_repository_shallow())
|
||||
die("attempt to fetch/clone from a shallow repository");
|
||||
git_config(upload_pack_config, NULL);
|
||||
if (getenv("GIT_DEBUG_SEND_PACK"))
|
||||
debug_fd = atoi(getenv("GIT_DEBUG_SEND_PACK"));
|
||||
upload_pack();
|
||||
return 0;
|
||||
}
|
||||
|
Reference in New Issue
Block a user