Re: [PATCH v17 03/10] receive-pack: add new proc-receive hook

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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.




[Index of Archives]     [Linux Kernel Development]     [Gcc Help]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [V4L]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]     [Fedora Users]

  Powered by Linux