tools: Add git utility scripts.

This commit is contained in:
derAnfaenger 2017-09-08 10:41:25 +02:00 committed by Tim Abbott
parent d05e932968
commit ea105ffec5
7 changed files with 242 additions and 0 deletions

View file

@ -0,0 +1,15 @@
#!/bin/bash
set -e
set -x
if ! git diff-index --quiet HEAD; then
set +x
echo "There are uncommitted changes:"
git status --short
echo "Doing nothing to avoid losing your work."
exit 1
fi
request_id="$1"
remote=${2:-"upstream"}
git fetch "$remote" "pull/$request_id/head"
git reset --hard FETCH_HEAD