From 72e904fb638c928ba1f12a1f58661eb374bdf494 Mon Sep 17 00:00:00 2001 From: Akumatic Date: Fri, 11 Apr 2025 12:56:36 +0000 Subject: [PATCH] Change check for update condition Instead of fetching from remote, it now only compares HEAD from local to HEAD of the current branch on remote --- update.sh | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/update.sh b/update.sh index d71bc54..5cc7baa 100755 --- a/update.sh +++ b/update.sh @@ -2,7 +2,11 @@ cd $(dirname $0) -if [[ $(git fetch) ]]; then +local_head=$(git rev-parse HEAD) +upstream_ref=$(git rev-parse --abbrev-ref @{u} | sed 's/\// /') +remote_head=$(git ls-remote $upstream_ref | cut -f1) + +if [[ $local_head != $remote_head ]]; then git pull docker compose pull docker compose up -d