mirror of
https://github.com/raspberrypi/rpi-update.git
synced 2026-01-21 06:13:34 +08:00
Updating a depth=1 git tree doesn't work, so just kill it and clone a new one
This commit is contained in:
24
rpi-update
24
rpi-update
@@ -126,27 +126,9 @@ function download_repo {
|
|||||||
}
|
}
|
||||||
|
|
||||||
function update_repo {
|
function update_repo {
|
||||||
echo " *** Updating firmware (this may take a few minutes)"
|
# updating a depth=1 git tree doesn't work, so just kill it and clone a new one
|
||||||
set +e
|
rm -rf ${FW_REPOLOCAL}
|
||||||
eval ${GITCMD} fetch --depth=1
|
download_repo
|
||||||
RETVAL=$?
|
|
||||||
set -e
|
|
||||||
if [[ ${RETVAL} -ne 0 ]]; then
|
|
||||||
echo " !!! Failed to fetch updated firmware files, trying a fresh checkout"
|
|
||||||
rm -rf ${FW_REPOLOCAL}
|
|
||||||
download_repo
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
set +e
|
|
||||||
eval ${GITCMD} reset --hard && eval ${GITCMD} clean -f -d && eval ${GITCMD} merge origin/master -m "automerge"
|
|
||||||
RETVAL=$?
|
|
||||||
set -e
|
|
||||||
if [[ ${RETVAL} -ne 0 ]]; then
|
|
||||||
echo " !!! Failed to merge updated firmware files, trying a fresh checkout"
|
|
||||||
rm -rf ${FW_REPOLOCAL}
|
|
||||||
download_repo
|
|
||||||
return
|
|
||||||
fi
|
|
||||||
}
|
}
|
||||||
|
|
||||||
function do_backup {
|
function do_backup {
|
||||||
|
|||||||
Reference in New Issue
Block a user