]> git.ipfire.org Git - thirdparty/git.git/commit - submodule.c
submodule--helper: teach push-check to handle HEAD
authorBrandon Williams <bmwill@google.com>
Thu, 20 Jul 2017 17:40:37 +0000 (10:40 -0700)
committerJunio C Hamano <gitster@pobox.com>
Thu, 20 Jul 2017 21:58:26 +0000 (14:58 -0700)
commitc7be7201a7b71f590325f0d858f909a4c0b443f6
tree1880ae1f4b6a9811f249c43f62e1c62167f613ae
parent06bf4ad1db92c32af38e16d9b7f928edbd647780
submodule--helper: teach push-check to handle HEAD

In 06bf4ad1d (push: propagate remote and refspec with
--recurse-submodules) push was taught how to propagate a refspec down to
submodules when the '--recurse-submodules' flag is given.  The only refspecs
that are allowed to be propagated are ones which name a ref which exists
in both the superproject and the submodule, with the caveat that 'HEAD'
was disallowed.

This patch teaches push-check (the submodule helper which determines if
a refspec can be propagated to a submodule) to permit propagating 'HEAD'
if and only if the superproject and the submodule both have the same
named branch checked out and the submodule is not in a detached head
state.

Signed-off-by: Brandon Williams <bmwill@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin/submodule--helper.c
submodule.c
t/t5531-deep-submodule-push.sh