Re: [PATCH 3/3] upload-pack: optionally allow fetching reachable sha1
Fredrik Medley <fredrik.medley@gmail.com> writes:
Show 10 quoted lines
> diff --git a/fetch-pack.c b/fetch-pack.c
> index 699f586..875b688 100644
> --- a/fetch-pack.c
> +++ b/fetch-pack.c
> @@ -45,7 +45,9 @@ static int marked;
> static struct prio_queue rev_list = { compare_commits_by_commit_date };
> static int non_common_revs, multi_ack, use_sideband;
> /* Allow specifying sha1 if it is a ref tip. */
> -#define ALLOW_TIP_SHA1 01
> +#define ALLOW_TIP_SHA1 01What is this change about? You do not have to align value columns.
> - if ((allow_unadvertised_object_request & ALLOW_TIP_SHA1)) {
> + if ((allow_unadvertised_object_request & (ALLOW_TIP_SHA1 | ALLOW_REACHABLE_SHA1))) {Perhaps wrap it like this?
if ((allow_unadvertised_object_request &
(ALLOW_TIP_SHA1 | ALLOW_REACHABLE_SHA1))) {Show 7 quoted lines
> @@ -444,7 +446,8 @@ static int get_common_commits(void)
>
> static int is_our_ref(struct object *o)
> {
> - int allow_hidden_ref = (allow_unadvertised_object_request & ALLOW_TIP_SHA1);
> + int allow_hidden_ref = (allow_unadvertised_object_request &
> + (ALLOW_TIP_SHA1 | ALLOW_REACHABLE_SHA1));Good, but push that to even more right?
Show 10 quoted lines
> @@ -793,6 +802,9 @@ static int upload_pack_config(const char *var, const char *value, void *unused)
> if (!strcmp("uploadpack.allowtipsha1inwant", var)) {
> if (git_config_bool(var, value))
> allow_unadvertised_object_request |= ALLOW_TIP_SHA1;
> + } else if (!strcmp("uploadpack.allowreachablesha1inwant", var)) {
> + if (git_config_bool(var, value))
> + allow_unadvertised_object_request |= ALLOW_REACHABLE_SHA1;
> } else if (!strcmp("uploadpack.keepalive", var)) {
> keepalive = git_config_int(var, value);
> if (!keepalive)Same issue as [2/3]
...
} else if (!strcmp("configVariable", var)) {
if (git_config_bool(var, value))
value |= ALLOW_THIS;
else
value &= ~ALLOW_THIS;
} else if ...should be OK.
Thanks.