mirror of
https://github.com/pi-hole/pi-hole
synced 2024-12-22 14:58:08 +00:00
Test if branch is locally available is not reliable because of possible ambiguities
This commit is contained in:
parent
d4a49d192f
commit
1b9e7fbf2e
@ -48,16 +48,10 @@ fetch_checkout_pull_branch() {
|
|||||||
local directory="${1}"
|
local directory="${1}"
|
||||||
local branch="${2}"
|
local branch="${2}"
|
||||||
|
|
||||||
# Check if branch exists locally
|
# Set the reference for the requested branch, fetch, check it put and pull it
|
||||||
if git rev-parse --quiet --verify "${branch}" &> /dev/null; then
|
git remote set-branches origin "${branch}" || return 1
|
||||||
# Branch exists locally, we can check it out and pull it
|
git fetch --quiet || return 1
|
||||||
checkout_pull_branch "${directory}" "${branch}" || return 1
|
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
|
|
||||||
}
|
}
|
||||||
|
|
||||||
checkout_pull_branch() {
|
checkout_pull_branch() {
|
||||||
|
Loading…
Reference in New Issue
Block a user