1
0
mirror of https://github.com/pi-hole/pi-hole synced 2024-11-19 22:58:16 +00:00

Can only diff once upstream branch is tracked

This commit is contained in:
DL6ER 2017-03-11 16:55:37 +01:00
parent 9a9d9007cd
commit 38547ced7a
No known key found for this signature in database
GPG Key ID: 00135ACBD90B28DD

View File

@ -63,11 +63,15 @@ checkout_pull_branch() {
local branch="${2}"
cd "${directory}" || return 1
if [ "$(git diff "${branch}" | grep -c "^")" -gt "0" ]; then
local oldbranch="$(git symbolic-ref HEAD)"
git checkout "${branch}" || return 1
if [ "$(git diff "${oldbranch}" | grep -c "^")" -gt "0" ]; then
update=true
fi
git checkout "${branch}" || return 1
git pull || return 1
return 0
}