Remove not working detection logic

Signed-off-by: Knut Ahlers <knut@ahlers.me>
This commit is contained in:
Knut Ahlers 2017-08-07 11:10:14 +02:00
parent 354f7099dd
commit 51926cb7d5
Signed by: luzifer
GPG key ID: DC2729FDD34BE99E

View file

@ -15,21 +15,12 @@ function step {
step "Collect refs to push to origin" step "Collect refs to push to origin"
CURRENT_BRANCH=$(git branch --list | awk '/^\*/{print $2}') CURRENT_BRANCH=$(git branch --list | awk '/^\*/{print $2}')
REQUIRED=$(git show-ref --tags | grep -v -F "$(git ls-remote --tags origin | grep -v '\^{}' | cut -f 2)" | cut -d '/' -f 3 | xargs)
if ( test "$(git show-ref refs/heads/${CURRENT_BRANCH} | cut -d ' ' -f 1)" != "$(git show-ref refs/remotes/origin/${CURRENT_BRANCH} | cut -d ' ' -f 1)" ); then
REQUIRED="${REQUIRED} ${CURRENT_BRANCH}"
fi
if [ -z "${REQUIRED}" ]; then
exit 0
fi
step "Execute pre-push auto-hook" step "Execute pre-push auto-hook"
git autohook pre-push git autohook pre-push
step "Execute pushes..." step "Execute pushes..."
git push origin ${REQUIRED} "$@" git push origin ${CURRENT_BRANCH} --tags "$@"
step "Execute post-push auto-hook" step "Execute post-push auto-hook"
git autohook post-push git autohook post-push