From 1b9e7fbf2e4d649ff512259f3949c39186434368 Mon Sep 17 00:00:00 2001 From: DL6ER Date: Sat, 11 Mar 2017 16:40:10 +0100 Subject: [PATCH] Test if branch is locally available is not reliable because of possible ambiguities --- advanced/Scripts/piholeCheckout.sh | 14 ++++---------- 1 file changed, 4 insertions(+), 10 deletions(-) diff --git a/advanced/Scripts/piholeCheckout.sh b/advanced/Scripts/piholeCheckout.sh index 6fd46fab..c255d822 100644 --- a/advanced/Scripts/piholeCheckout.sh +++ b/advanced/Scripts/piholeCheckout.sh @@ -48,16 +48,10 @@ fetch_checkout_pull_branch() { local directory="${1}" local branch="${2}" - # Check if branch exists locally - if git rev-parse --quiet --verify "${branch}" &> /dev/null; then - # Branch exists locally, we can check it out and pull it - checkout_pull_branch "${directory}" "${branch}" || return 1 - else - # Branch does not exist locally, we set the reference for it, fetch, check it put and pull it - git remote set-branches origin "${branch}" || return 1 - git fetch --quiet || return 1 - checkout_pull_branch "${directory}" "${branch}" || return 1 - fi + # Set the reference for the requested branch, fetch, check it put and pull it + git remote set-branches origin "${branch}" || return 1 + git fetch --quiet || return 1 + checkout_pull_branch "${directory}" "${branch}" || return 1 } checkout_pull_branch() {