submodule--helper update-clone: abort gracefully on missing .gitmodules
authorStefan Beller <sbeller@google.com>
Thu, 28 Apr 2016 20:02:46 +0000 (13:02 -0700)
committerJunio C Hamano <gitster@pobox.com>
Fri, 29 Apr 2016 17:07:13 +0000 (10:07 -0700)
commit08fdbdb153c138f0a2dc85949475fafb20853d96
treef3d62ae553d8f4db4c025817eeca99df6886360c
parentd92028a575dde9c325e23f89c3d2b24f13868c57
submodule--helper update-clone: abort gracefully on missing .gitmodules

When there is no .gitmodules file availabe to initialize a submodule
from, `submodule_from_path` just returns NULL. We need to check for
that and abort gracefully.

When `git submodule update` was implemented in shell, this error out
with the warning

    Submodule path '%s' not initialized
    Maybe you want to use 'update --init'?

Replicate that behavior for now instead of crashing.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/submodule--helper.c
t/t7400-submodule-basic.sh