mirror of
https://github.com/mrworf/plexupdate.git
synced 2025-08-20 21:33:16 -07:00
Improved git branch handling for testing
This commit is contained in:
parent
ebd6a5876b
commit
306edf9d0d
1 changed files with 5 additions and 1 deletions
|
@ -228,8 +228,12 @@ if [ "${AUTOUPDATE}" = "yes" ]; then
|
|||
elif ! git diff --quiet; then
|
||||
warn "You have made changes to the plexupdate files, cannot auto update"
|
||||
else
|
||||
BRANCHNAME="${BRANCHNAME:-master}"
|
||||
if [ "${BRANCHNAME}" != "$(git symbolic-ref -q --short HEAD)" ]; then
|
||||
git checkout "${BRANCHNAME}"
|
||||
fi
|
||||
# Force FETCH_HEAD to point to the correct branch (for older versions of git which don't default to current branch)
|
||||
if git fetch origin ${BRANCHNAME:-master} --quiet && ! git diff --quiet FETCH_HEAD; then
|
||||
if git fetch origin ${BRANCHNAME} --quiet && ! git diff --quiet FETCH_HEAD; then
|
||||
info "Auto-updating..."
|
||||
|
||||
# Use an associative array to store permissions. If you're running bash < 4, the declare will fail and we'll
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue