Skip to content

Commit

Permalink
Add script to fetch pull request
Browse files Browse the repository at this point in the history
  • Loading branch information
RishabhJain2018 committed May 26, 2018
1 parent 82dc856 commit a96fc3f
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions scripts/tools/fetch_pull_request
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
#!/bin/bash
if [ "$1" == "--help" ]; then
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"
exit 1
elif [ $# -eq 0 ]; then
echo "Pull request id not given."
exit 1
else
set -e -x
remote=${2:-origin}
git branch -D review-$1 || git fetch $remote pull/$1/head:review-$1
git checkout review-$1
fi

0 comments on commit a96fc3f

Please sign in to comment.