]> git.ipfire.org Git - thirdparty/tvheadend.git/commitdiff
improve update in support/getmuxlist
authorJaroslav Kysela <perex@perex.cz>
Fri, 5 May 2017 11:25:26 +0000 (13:25 +0200)
committerJaroslav Kysela <perex@perex.cz>
Fri, 5 May 2017 11:26:37 +0000 (13:26 +0200)
support/getmuxlist

index 5fe4c72a7962ccf04fd64f18e34af6bb9f66e4aa..33b61bbd4c1d74b470205f5dc17fa3f1ae76e157 100755 (executable)
@@ -11,9 +11,13 @@ DIR=$1
 if [ -d "${DIR}/.git" ]; then
   LAST=$(pwd)
   cd "${DIR}" || exit 1
-  git fetch > /dev/null 2>&1 || exit 1
-  git reset --hard > /dev/null 2>&1 || exit 1
-  git pull > /dev/null 2>&1 || exit 1
+  git fetch --tags > /dev/null 2>&1 || exit 1
+  hash1=$(git rev-parse HEAD)
+  hash2=$(git rev-parse origin/tvheadend)
+  if [ "$hash1" != "$hash2" ]; then
+    git reset --hard origin/master > /dev/null 2>&1 || exit 1
+    git pull > /dev/null 2>&1 || exit 1
+  fi
   cd "${LAST}" || exit 1
 # Fetch
 elif [ ! -d "${DIR}" ]; then