Skip to content

Commit

Permalink
Merge pull request #16 from kemenaran/patch-1
Browse files Browse the repository at this point in the history
Improve detection of the target branch
  • Loading branch information
caarlos0 authored Mar 8, 2017
2 parents f499e53 + c4042e2 commit 759f21b
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions git-open-pr.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ _build_url() {
repo="$(_get_repo "$origin")"
pr_url="https://github.com/$repo/pull/new"
target="$1"
test -z "$target" && target=$(git for-each-ref --format='%(upstream:short)' "$(git symbolic-ref -q HEAD)" | cut -d '/' -f 2)
test -z "$target" && target="master"
if [ -z "$upstream" ]; then
echo "$pr_url/$target...$branch"
Expand Down

0 comments on commit 759f21b

Please sign in to comment.