From c66e9536fedadbac096bbfb96e1b7acd07d31b92 Mon Sep 17 00:00:00 2001 From: TJ Holowaychuk Date: Fri, 29 Jun 2012 13:23:19 -0700 Subject: [PATCH] fix some quoting in git-pull-request and ensure the remote is available --- bin/git-pull-request | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/bin/git-pull-request b/bin/git-pull-request index b5ebad3..5db1186 100755 --- a/bin/git-pull-request +++ b/bin/git-pull-request @@ -31,7 +31,11 @@ test -z "$user" && abort "git config user.email required" # branch -branch=${1-$(git symbolic-ref HEAD)} +branch=${1-$(git symbolic-ref HEAD | sed 's/refs\/heads\///')} + +# make sure it's pushed + +git push origin $branch || abort "failed to push $branch" # lame hack to get project @@ -48,6 +52,7 @@ echo # create pull request -body=$(json $title $body $branch) +body=$(json "$title" "$body" $branch) +echo curl -u "$user" "https://api.github.com/repos/$project/pulls" -d "$body" curl -u "$user" "https://api.github.com/repos/$project/pulls" -d "$body"