Download raw body.
got fetch downloads too much
On Wed, Oct 06, 2021 at 08:30:33PM +0200, Stefan Sperling wrote:
> @@ -457,6 +480,14 @@ fetch_pack(int fd, int packfd, uint8_t *pack_sha1,
>  			err = got_error(GOT_ERR_BAD_OBJ_ID_STR);
>  			goto done;
>  		}
> +		if (match_remote_object_id(have_refs, &want[nref])) {
> +			if (chattygot) {
> +				fprintf(stderr,
> +				    "%s: not fetching %s, we already have %s\n",
> +				    getprogname(), refname, id_str);
> +			}
> +			continue;
> +		}
By the way, id_str should be freed here. But the existing code
does not free it properly and memory for refname is also leaked.
So I would rather fix all of that in a follow-up patch.
got fetch downloads too much