diff --git a/build-scripts/addons/repositories.sh b/build-scripts/addons/repositories.sh index 3108a16638..0b7f91b0a8 100755 --- a/build-scripts/addons/repositories.sh +++ b/build-scripts/addons/repositories.sh @@ -31,3 +31,9 @@ done echo "${ADDONS_REPOS_ENABLED}" > addons/.auto-add cp -r "addons" "${INSTALL}/addons" + +cat > ${INSTALL}/gitconfig << EOF +[safe] + directory = /snap/microk8s/current/addons/community/.git + +EOF diff --git a/snap/hooks/install b/snap/hooks/install index a60f5459d8..3b35489c3c 100755 --- a/snap/hooks/install +++ b/snap/hooks/install @@ -148,12 +148,7 @@ then touch ${SNAP_DATA}/var/lock/low-memory-guard.lock fi -SNAP_CURRENT=`echo "${SNAP}" | sed -e "s,${SNAP_REVISION},current,"` -# create git config file -cat > ${SNAP_COMMON}/.gitconfig << EOF -[safe] - directory = ${SNAP_CURRENT}/addons/community/.git - -EOF +# copy git config +cp ${SNAP}/gitconfig ${SNAP_COMMON}/.gitconfig touch "${SNAP_DATA}/var/lock/installed.lock"