Re: [PATCH 3/4] submodule.c: harden submodule_move_head against broken submodules
- From
- Brandon Williams <bmwill@google.com>
- Date
- Apr 13, 2017, 19:08 UTC
- Message-ID
- <20170413190839.GE96917@google.com>
- In-Reply-To
- <20170411234923.1860-4-sbeller@google.com>
On 04/11, Stefan Beller wrote:
Show 12 quoted lines
> Early on in submodule_move_head just after the check if the submodule is > initialized, we need to check if the submodule is populated correctly. > > If the submodule is initialized but doesn't look like populated, this > is a red flag and can indicate multiple sorts of failures: > (1) The submodule may be recorded at an object name, that is missing. > (2) The submodule '.git' file link may be broken and it is not pointing > at a repository. > > In both cases we want to complain to the user in the non-forced mode, > and in the forced mode ignoring the old state and just moving the > submodule into its new state with a fixed '.git' file link.
What about the case where you have marked a submodule as active but don't have its respective .gitdir yet? For now i think it would be acceptable to complain and do nothing/ignore it, in the future we may want to actually clone and then check it out.
-- Brandon Williams