2018-12-18 02:08:53 +01:00
|
|
|
#!/usr/bin/env bash
|
2017-06-01 19:59:52 +02:00
|
|
|
set -e
|
|
|
|
|
2020-03-26 02:27:15 +01:00
|
|
|
this_file=$(readlink -f "${BASH_SOURCE[0]}")
|
|
|
|
# shellcheck source=lib/git-tools.bash
|
|
|
|
. "${this_file%/*}"/lib/git-tools.bash
|
|
|
|
|
|
|
|
require_clean_work_tree 'check out PR as branch'
|
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
|