shithub: moonfish

ref: 67d3ac8d4a497a6b51d11b5848f964797fd098b8
dir: /scripts/offload.sh/

View raw version
#!/usr/bin/env bash

# moonfish is licensed under the AGPL (v3 or later)
# copyright 2024 zamfofex

set -ex
set -o shwordsplit || :

undo=no
git add .
git commit -m xxx && undo=yes
git push --force --all tests

rev1="$(git rev-parse HEAD)"

[[ "$undo" = yes ]] && git reset HEAD~

rev2="$(git rev-parse "${1:-main}")"

url="$(git remote get-url tests)"
ssh="${url%%:*}"
dir="${url#*:}"

ssh "$ssh" -- "cd '$dir/..' && git reset --hard '$rev1' && scripts/compare.sh '$rev2'"