add submodule handling

This commit is contained in:
Jakobus Schürz 2022-10-11 14:50:49 +02:00 committed by Jakobus Schürz
parent ae895459a9
commit 9de940dd51

View file

@ -90,8 +90,9 @@ fi
#echo $SGIT fetch ${MSC_GIT_REMOTE_NAME} -p 1>&2
if $dorepoupdate; then
loginfo "git submodule sync"
logdebug "$(git submodule sync 2>&1)"
loginfo "fetch repo${dosubmodupdate:+ and submodules}"
#$SGIT fetch ${dosubmodupdate:+--recurse-submodules} ${MSC_GIT_REMOTE_NAME} -p 2>>"${MSC_LOGFILE}"|| { logwarning fetch failed; gitupdateend; exit 1; }
$SGIT fetch ${dosubmodupdate:+--recurse-submodules} ${MSC_GIT_REMOTE_NAME} -p 2>>"${MSC_LOGFILE}"|| { logwarning fetch failed; gitupdateend; exit 1; }
if ${dosubmodupdate:-false}; then
lastupdatesubmodules
@ -105,6 +106,9 @@ if $dorepoupdate; then
EOF
$SGIT checkout ${PRE}${PRE:+/}${MSC_GIT_BRANCH} 1>>"${MSC_LOGFILE}" 2>>"${MSC_LOGFILE}"|| { gitupdateend; exit 2; }
$SGIT merge FETCH_HEAD 1>>"${MSC_LOGFILE}" 2>>"${MSC_LOGFILE}"|| { gitupdateend; exit 3; }
if ${dosubmodupdate:+false}; then
$SGIT submodule update --init --recursive
fi
touch $MSC_GIT_UPD_REPO_STATFILE
else
logwarning -n " Lokale Änderungen festgestellt:"