submodule--helper: add remote-branch helper

In a later patch we want to enhance the logic for the branch selection.
Rewrite the current logic to be in C, so we can directly use C when
we enhance the logic.

Signed-off-by: Stefan Beller <sbeller@google.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Stefan Beller
2016-08-03 13:44:03 -07:00
committed by Junio C Hamano
parent b5944f3476
commit 92bbe7ccf1
2 changed files with 36 additions and 2 deletions

View File

@ -614,7 +614,7 @@ cmd_update()
if test -n "$remote"
then
branch=$(get_submodule_config "$name" branch master)
branch=$(git submodule--helper remote-branch "$sm_path")
if test -z "$nofetch"
then
# Fetch remote before determining tracking $sha1