Skip to content

Commit a96fc3f

Browse files
Add script to fetch pull request
1 parent 82dc856 commit a96fc3f

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

scripts/tools/fetch_pull_request

+13
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/bash
2+
if [ "$1" == "--help" ]; then
3+
printf "Usage: fetch-pull-request [--help] pull_request_id [remote=origin] \n\n Locally fetch a pull request and test it. \n Remote is set to origin by default.\n"
4+
exit 1
5+
elif [ $# -eq 0 ]; then
6+
echo "Pull request id not given."
7+
exit 1
8+
else
9+
set -e -x
10+
remote=${2:-origin}
11+
git branch -D review-$1 || git fetch $remote pull/$1/head:review-$1
12+
git checkout review-$1
13+
fi

0 commit comments

Comments
 (0)