Re: [PATCH v6 8/9] pack-objects: introduce '--stdin-packs=follow'

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

 



Taylor Blau <me@xxxxxxxxxxxx> writes:

>  static void show_object_pack_hint(struct object *object, const char *name,
> -				  void *data UNUSED)
> +				  void *data)
>  {
> -	struct object_entry *oe = packlist_find(&to_pack, &object->oid);
> -	if (!oe)
> -		return;
> +	enum stdin_packs_mode mode = *(enum stdin_packs_mode *)data;
> +	if (mode == STDIN_PACKS_MODE_FOLLOW) {
> +		if (object->type == OBJ_BLOB &&
> +		    !has_object(the_repository, &object->oid, 0))
> +			return;

So, --stdin-packs opened a pack and is feeding the objects contained
in it to this machinery.  show_commit_pack_hint() calls this
function in the `follow` mode.  How would such an object be missing?
Ah, lazy clones.  OK.

> +		add_object_entry(&object->oid, object->type, name, 0);
> +	} else {

And only up to this point is the new code.  The "else" clause is
just the original indented one-level deeper.

> +static void show_commit_pack_hint(struct commit *commit, void *data)
>  {
> +	enum stdin_packs_mode mode = *(enum stdin_packs_mode *)data;
> +
> +	if (mode == STDIN_PACKS_MODE_FOLLOW) {
> +		show_object_pack_hint((struct object *)commit, "", data);
> +		return;
> +	}
> +
>  	/* nothing to do; commits don't have a namehash */
> +
>  }

What is this new blank line doing here?






[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