Re: [PATCH 1/3] '--missing' option for mktree: re-added strbuf_release(&p_uq), Updated man page

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

 



Josh Micich <josh.micich@xxxxxxxxx> writes:

>  DESCRIPTION
>  -----------
> -Reads standard input in non-recursive `ls-tree` output format,
> -and creates a tree object.  The object name of the tree object
> +Reads standard input in non-recursive `ls-tree` output format, and creates
> +a tree object.  The order of the tree entries is normalised by mktree so
> +pre-sorting the input is not required.  The object name of the tree object
>  built is written to the standard output.

Thanks ;-)

>  OPTIONS
>  -------
>  -z::
>  	Read the NUL-terminated `ls-tree -z` output instead.
> +--missing::
> +	Allow missing objects.  The default behaviour (without this option)
> +	is to verify that each tree entry's sha1 identifies an existing
> +	object.

I'd suggest adding "... except for gitlink entries (aka "submodules") that
are always allowed to be missing" here.

> @@ -112,6 +112,9 @@ static void mktree_line(char *buf, size_t len, int 
> line_termination, int allow_m
>  		if (unquote_c_style(&p_uq, path, NULL))
>  			die("invalid quoting");
>  		path = strbuf_detach(&p_uq, NULL);
> +		append_to_tree(mode, sha1, path);
> +		strbuf_release(&p_uq);
> +		return;
>  	}
>  	append_to_tree(mode, sha1, path);
>  }

Ehh, why?  detach already detaches the allocated buffer from strbuf and
there is nothing to clean up by strbuf_release().
--
To unsubscribe from this list: send the line "unsubscribe git" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[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]