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 9491f9f017
commit 2ab30111e9

View file

@ -90,6 +90,8 @@ fi
#echo $MSC_GIT 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}"
#$MSC_GIT fetch ${dosubmodupdate:+--recurse-submodules} ${MSC_GIT_REMOTE_NAME} -p 2>>"${MSC_LOGFILE}"|| { logwarning fetch failed; gitupdateend; exit 1; }
$MSC_GIT fetch ${dosubmodupdate:+--recurse-submodules} ${MSC_GIT_REMOTE_NAME} -p 2>>"${MSC_LOGFILE}"|| { logwarning fetch failed; gitupdateend; exit 1; }
@ -103,8 +105,11 @@ if $dorepoupdate; then
no changes in local repo
$MSC_GIT checkout ${PRE}${PRE:+/}${MSC_GIT_BRANCH}
EOF
$MSC_GIT checkout ${PRE}${PRE:+/}${MSC_GIT_BRANCH} 1>>"${MSC_LOGFILE}" 2>>"${MSC_LOGFILE}"|| { gitupdateend; exit 2; }
$MSC_GIT merge FETCH_HEAD 1>>"${MSC_LOGFILE}" 2>>"${MSC_LOGFILE}"|| { gitupdateend; exit 3; }
$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:"