Skip to content

Commit

Permalink
git-fetch-pull-request: allow user to force the creation
Browse files Browse the repository at this point in the history
This is helpful when the pull request has been fixed up and you already
have a local branch.
  • Loading branch information
jszakmeister committed Dec 18, 2014
1 parent 8200e24 commit 66a592a
Showing 1 changed file with 23 additions and 1 deletion.
24 changes: 23 additions & 1 deletion git-addons/git-fetch-pull-request
Expand Up @@ -29,10 +29,32 @@ fetch() {
cmd="git fetch $upstream "
for var in "$@"
do
cmd="$cmd pull/$var/head:pr-$var"
cmd="$cmd ${REFSPEC_PREFIX}pull/$var/head:pr-$var"
done

$cmd || die "Could not fetch all the pull requests."
}

while [[ $# > 0 ]]
do
key="$1"

case $key in
-f|--force)
REFSPEC_PREFIX="+"
shift
;;
*)
if [[ "$key" == -* ]]
then
# unknown option
die "Unknown option '$key'"
else
break
fi
;;
esac
done


fetch "$@"

0 comments on commit 66a592a

Please sign in to comment.