From 2e398c5da472a7049f33b8e57efdb59c301e0385 Mon Sep 17 00:00:00 2001 From: Adam Warner Date: Fri, 14 Apr 2017 17:20:13 +0100 Subject: [PATCH 1/2] stash changes on branch switch, else it fails if any changes have been made. --- advanced/Scripts/piholeCheckout.sh | 2 ++ 1 file changed, 2 insertions(+) diff --git a/advanced/Scripts/piholeCheckout.sh b/advanced/Scripts/piholeCheckout.sh index 09f20d6b..66e435c7 100644 --- a/advanced/Scripts/piholeCheckout.sh +++ b/advanced/Scripts/piholeCheckout.sh @@ -54,6 +54,8 @@ fetch_checkout_pull_branch() { # Set the reference for the requested branch, fetch, check it put and pull it cd "${directory}" git remote set-branches origin "${branch}" || return 1 + git stash --all --quiet &> /dev/null || return 1 + git clean --force -d || return 1 git fetch --quiet || return 1 checkout_pull_branch "${directory}" "${branch}" || return 1 } From db1e5f10ea1850f0e29a50d6f1beccbf20616e56 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Fri, 21 Apr 2017 17:08:15 +0200 Subject: [PATCH 2/2] Make changes according to comment in #1384 --- advanced/Scripts/piholeCheckout.sh | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/advanced/Scripts/piholeCheckout.sh b/advanced/Scripts/piholeCheckout.sh index 66e435c7..c5b77368 100644 --- a/advanced/Scripts/piholeCheckout.sh +++ b/advanced/Scripts/piholeCheckout.sh @@ -54,8 +54,8 @@ fetch_checkout_pull_branch() { # Set the reference for the requested branch, fetch, check it put and pull it cd "${directory}" git remote set-branches origin "${branch}" || return 1 - git stash --all --quiet &> /dev/null || return 1 - git clean --force -d || return 1 + git stash --all --quiet &> /dev/null || true + git clean --force -d || true git fetch --quiet || return 1 checkout_pull_branch "${directory}" "${branch}" || return 1 }