Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/pi-hole/pi-hole.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorRD WebDesign <github@rdwebdesign.com.br>2022-07-08 03:41:09 +0300
committerRD WebDesign <github@rdwebdesign.com.br>2022-10-09 22:35:33 +0300
commit18bfae057ed8e4fd092b7a18ca621efff73779b2 (patch)
treead0096a8245df04a8f2c627090dff2ac370c7daf
parent46986714d41732f99cb4f4fd57d0fbc787a4aa76 (diff)
Run git reset before pulling, to avoid error on dirty master branchreset_before_pull
also adding line breaks for readability Signed-off-by: RD WebDesign <github@rdwebdesign.com.br>
-rwxr-xr-xautomated install/basic-install.sh8
1 files changed, 6 insertions, 2 deletions
diff --git a/automated install/basic-install.sh b/automated install/basic-install.sh
index f3df72e6..3e6089b6 100755
--- a/automated install/basic-install.sh
+++ b/automated install/basic-install.sh
@@ -470,17 +470,21 @@ update_repo() {
pushd "${directory}" &> /dev/null || return 1
# Let the user know what's happening
printf " %b %s..." "${INFO}" "${str}"
+
# Stash any local commits as they conflict with our working code
git stash --all --quiet &> /dev/null || true # Okay for stash failure
git clean --quiet --force -d || true # Okay for already clean directory
- # Pull the latest commits
- git pull --no-rebase --quiet &> /dev/null || return $?
+
# Check current branch. If it is master, then reset to the latest available tag.
# In case extra commits have been added after tagging/release (i.e in case of metadata updates/README.MD tweaks)
curBranch=$(git rev-parse --abbrev-ref HEAD)
if [[ "${curBranch}" == "master" ]]; then
git reset --hard "$(git describe --abbrev=0 --tags)" || return $?
fi
+
+ # Pull the latest commits
+ git pull --no-rebase --quiet &> /dev/null || return $?
+
# Show a completion message
printf "%b %b %s\\n" "${OVER}" "${TICK}" "${str}"
# Data in the repositories is public anyway so we can make it readable by everyone (+r to keep executable permission if already set by git)