Jiang Xin <worldhello.net@xxxxxxxxx> writes: > > Suggested-by: Junio C Hamano <gitster@xxxxxxxxx> Did I???? I do not think I deserve any credit here. > Signed-off-by: Jiang Xin <zhiyou.jx@xxxxxxxxxxxxxxx> > +static struct command *find_command_by_refname(const struct command *list, > + const char *refname) > +{ > + for (; list; list = list->next) > + if (!strcmp(list->ref_name, refname)) > + return (struct command *)list; > + return NULL; > +} Does the last cast really needed, perhaps the caller is adding "const" to its objects where it is not needed, or the variable caller uses to receive the returned value of too loose a type? > diff --git a/t/helper/test-proc-receive.c b/t/helper/test-proc-receive.c > new file mode 100644 > index 0000000000..4f352a7baf > --- /dev/null > +++ b/t/helper/test-proc-receive.c > @@ -0,0 +1,176 @@ > +#include "cache.h" > +#include "connect.h" > +#include "parse-options.h" > +#include "pkt-line.h" > +#include "sigchain.h" > +#include "test-tool.h" > + > +static const char *proc_receive_usage[] = { > + "test-tool proc-receive [<options>...]", > + NULL > +}; > + > +static int die_version = 0; > +static int die_readline = 0; > +static int no_push_options = 0; > +static int use_atomic = 0; > +static int use_push_options = 0; > +static int verbose = 0; Let BSS do its job by omitting " = 0;" and " = NULL;" at the end.