From 3c70695651c515a6e1eccd8b9987f76c459938b2 Mon Sep 17 00:00:00 2001 From: remittor Date: Mon, 22 Aug 2022 12:33:25 +0300 Subject: [PATCH] Fix git reset --- xupdate.sh | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/xupdate.sh b/xupdate.sh index 2e957d9..de01450 100755 --- a/xupdate.sh +++ b/xupdate.sh @@ -32,8 +32,13 @@ git reset --hard HEAD git fetch [ "$?" != "0" ] && die "Can't fetch current repository" -git pull --force "origin" -[ "$?" != "0" ] && die "Can't pull current repository" +git pull --force "origin" &> /dev/null +#[ "$?" != "0" ] && die "Can't pull current repository" + +CUR_BRANCH=$( git rev-parse --abbrev-ref HEAD ) + +git reset --hard origin/$CUR_BRANCH +[ "$?" != "0" ] && die "Can't reset current repository" rm -f feeds.conf cp -f feeds.conf.default feeds.conf