2018-12-18 02:08:53 +01:00
|
|
|
#!/usr/bin/env bash
|
2017-06-01 19:59:52 +02:00
|
|
|
set -e
|
|
|
|
|
|
|
|
if ! git diff-index --quiet HEAD; then
|
|
|
|
echo "There are uncommitted changes:"
|
|
|
|
git status --short
|
|
|
|
echo "Doing nothing to avoid losing your work."
|
|
|
|
exit 1
|
|
|
|
fi
|
2020-03-26 02:28:31 +01:00
|
|
|
|
2017-06-01 19:59:52 +02:00
|
|
|
request_id="$1"
|
|
|
|
remote=${2:-"upstream"}
|
2020-03-26 02:28:31 +01:00
|
|
|
|
|
|
|
set -x
|
2017-06-01 19:59:52 +02:00
|
|
|
git fetch "$remote" "pull/$request_id/head"
|
|
|
|
git checkout -B "review-original-${request_id}"
|
|
|
|
git reset --hard FETCH_HEAD
|