mirror of
https://github.com/pi-hole/pi-hole
synced 2025-01-03 12:40:56 +00:00
Script runs in subshell, no need to cd back to pwd.
Signed-off-by: Dan Schaper <dan.schaper@pi-hole.net>
This commit is contained in:
parent
c3c7dcc9f5
commit
0a0d25dff4
@ -33,13 +33,10 @@ fully_fetch_repo() {
|
|||||||
get_available_branches(){
|
get_available_branches(){
|
||||||
# Return available branches
|
# Return available branches
|
||||||
local directory="${1}"
|
local directory="${1}"
|
||||||
local curdir
|
|
||||||
|
|
||||||
curdir="${PWD}"
|
|
||||||
cd "${directory}" || return 1
|
cd "${directory}" || return 1
|
||||||
# Get reachable remote branches
|
# Get reachable remote branches
|
||||||
git remote show origin | grep 'tracked' | sed 's/tracked//;s/ //g'
|
git remote show origin | grep 'tracked' | sed 's/tracked//;s/ //g'
|
||||||
cd "${curdir}" || return 1
|
|
||||||
return
|
return
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -47,14 +44,11 @@ checkout_pull_branch() {
|
|||||||
# Check out specified branch
|
# Check out specified branch
|
||||||
local directory="${1}"
|
local directory="${1}"
|
||||||
local branch="${2}"
|
local branch="${2}"
|
||||||
local curdir
|
|
||||||
|
|
||||||
curdir="${PWD}"
|
|
||||||
cd "${directory}" || return 1
|
cd "${directory}" || return 1
|
||||||
git checkout "${branch}"
|
git checkout "${branch}" || return 1
|
||||||
git pull
|
git pull || return 1
|
||||||
cd "${curdir}" || return 1
|
return 0
|
||||||
return
|
|
||||||
}
|
}
|
||||||
|
|
||||||
warning1() {
|
warning1() {
|
||||||
|
Loading…
Reference in New Issue
Block a user