From 89ff99322d598027eb615c02779466afd08b5303 Mon Sep 17 00:00:00 2001 From: Dan Schaper Date: Wed, 8 Mar 2017 13:30:08 -0800 Subject: [PATCH] Don't need to remember `pwd` inside a function, calling function doesn't change directories. Signed-off-by: Dan Schaper --- advanced/Scripts/piholeCheckout.sh | 9 ++------- 1 file changed, 2 insertions(+), 7 deletions(-) diff --git a/advanced/Scripts/piholeCheckout.sh b/advanced/Scripts/piholeCheckout.sh index 4133facb..732434a1 100644 --- a/advanced/Scripts/piholeCheckout.sh +++ b/advanced/Scripts/piholeCheckout.sh @@ -21,15 +21,10 @@ readonly PI_HOLE_GIT_URL="https://github.com/pi-hole/pi-hole.git" fully_fetch_repo() { # Add upstream branches to shallow clone local directory="${1}" - local curdir - local rc - curdir="${PWD}" cd "${directory}" || return 1 - git remote set-branches origin '*' || return 1 - git fetch --quiet || return 1 - cd "${curdir}" || return 1 - return + git fetch --quiet --unshallow || return 1 + return 0 } get_available_branches(){