Re: [PATCH v3 1/9] tree: do not use the_repository for tree traversal methods.

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

 



"Alphadelta14 via GitGitGadget" <gitgitgadget@xxxxxxxxx> writes:

> From: Alphadelta14 <alpha@alphaservcomputing.solutions>

I'll fix this line to match all the other patches in the series
before applying.

> Expect that tree walking may switch repository contexts for cases
> such as submodules.
> Added compatibility macros for existing cases.
>
> Annotate an existing issue where repo is wrong when traversing.
>
> Signed-off-by: Heather Lapointe <alpha@alphaservcomputing.solutions>
> ---


> @@ -58,7 +58,11 @@ int read_tree_at(struct repository *r,
>  				    oid_to_hex(&entry.oid),
>  				    base->buf, entry.path);
>  
> -			if (parse_commit(commit))
> +			// FIXME: This is the wrong repo instance (it refers to the superproject)
> +			// it will always fail as is (will fix in later patch)
> +			// This current codepath isn't executed by any existing callbacks
> +			// so it wouldn't show up as an issue at this time.

	/*
	 * We write our multi-line comments
	 * this way.
	 */

My suspicion is that the if/else if/ cascade for GITLINK assumes
that the caller earlier did add_submodule_odb() to make sure any
object it needs should be available via the_repository->objects
object store.  If your caller (presumably "archive that is trying to
learn the --recurse-submodules option") hasn't learned to do so yet
at this step, it is understandable if it fails.

> +			if (repo_parse_commit(r, commit))
>  				die("Invalid commit %s in submodule path %s%s",
>  				    oid_to_hex(&entry.oid),
>  				    base->buf, entry.path);

> +#ifndef NO_THE_REPOSITORY_COMPATIBILITY_MACROS
> +#define parse_tree(tree) repo_parse_tree(the_repository, tree)
> +#define parse_tree_gently(tree, quiet_on_missing) repo_parse_tree_gently(the_repository, tree, quiet_on_missing)
> +#define parse_tree_indirect(oid) repo_parse_tree_indirect(the_repository, oid)
> +#endif

Good.



[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