Re: [PATCH 12/15] unpack-trees: check if we can perform the operation for submodules

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

 



Stefan Beller <sbeller@xxxxxxxxxx> writes:

> +
> +	/* ERROR_WOULD_LOSE_UNTRACKED_SUBMODULE */
> +	"Submodule '%s' cannot be deleted as it contains untracked files.",

OK.

> +	msgs[ERROR_WOULD_LOSE_UNTRACKED_SUBMODULE] =
> +		_("Submodule '%s' cannot be deleted as it contains untracked files.");

OK again.

> @@ -240,12 +246,44 @@ static void display_error_msgs(struct unpack_trees_options *o)
>  		fprintf(stderr, _("Aborting\n"));
>  }
>  
> +static int submodule_check_from_to(const struct cache_entry *ce, const char *old_id, const char *new_id, struct unpack_trees_options *o)
> +{
> +	if (submodule_go_from_to(ce->name, old_id,
> +				 new_id, 1, o->reset))
> +		return o->gently ? -1 :
> +			add_rejected_path(o, ERROR_WOULD_LOSE_UNTRACKED_SUBMODULE, ce->name);

Is potential loss of untracked paths the only reason
submodule_go_from_to() would fail?  I somehow thought that it would
not even care about untracked paths but cared deeply about already
added changes.




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