1
0
mirror of https://github.com/pi-hole/pi-hole synced 2024-12-22 23:08:07 +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}" local branch="${2}"
cd "${directory}" || return 1 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 update=true
fi fi
git checkout "${branch}" || return 1
git pull || return 1 git pull || return 1
return 0 return 0
} }