push, fetch: error out for submodule entries not pointing to commits
commit3c96aa97232367a24eef8b3b387f5ddae5b0c10f
authorStefan Beller <sbeller@google.com>
Tue, 12 Sep 2017 17:30:27 +0000 (12 10:30 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 14 Sep 2017 06:05:51 +0000 (14 15:05 +0900)
tree63b2cfeb38174fdf5e607561c2a7b8feb9671550
parent607bd8315c6886eb61561bbba394616bc6fdf031
push, fetch: error out for submodule entries not pointing to commits

The check_has_commit helper uses resolves a submodule entry to a
commit, when validating its existence. As a side effect this means
tolerates a submodule entry pointing to a tag, which is not a valid
submodule entry that git commands would know how to cope with.

Tighten the check to require an actual commit, not a tag pointing to a
commit.

Also improve the error handling when a submodule entry points to
non-commit (e.g., a blob) to error out instead of warning and
pretending the pointed to object doesn't exist.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
submodule.c
t/t5531-deep-submodule-push.sh