Zulip server and web application. Open-source team chat that helps teams stay productive and focused.
#!/usr/bin/env bash
set -euo pipefail
this_dir=${BASH_SOURCE[0]%/*}
# shellcheck source=lib/git-tools.bash
. "${this_dir}"/lib/git-tools.bash
require_clean_work_tree 'check out PR as branch'
request_id="${1-}"
if [ -z "$request_id" ]; then
echo "Usage: $0 pr_id" >&2
exit 1
fi
remote=${2:-"upstream"}
set -x
git fetch "$remote" "pull/$request_id/head"
git checkout -B "review-original-${request_id}"
git reset --hard FETCH_HEAD