Clean up git-pull-request

This commit is contained in:
Luke Childs 2016-07-30 10:36:14 +01:00
parent a3c03d021e
commit 82b6eb4331

View file

@ -5,7 +5,7 @@
#
abort() {
echo $@
echo >&2 "$@"
exit 1
}
@ -39,9 +39,7 @@ 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
git push origin "$branch" || abort "failed to push $branch"
origin=$(git config remote.origin.url)
if [[ $origin == git@* ]]; then
@ -56,9 +54,9 @@ project=${project%.git}
echo
echo " create pull-request for $project '$branch'"
echo
printf " title: " && read title
printf " body: " && read body
printf " base [master]: " && read base
printf " title: " && read -r title
printf " body: " && read -r body
printf " base [master]: " && read -r base
echo
# create pull request
@ -68,7 +66,7 @@ then
base="master"
fi
body=$(json "$title" "$body" $branch "$base")
body=$(json "$title" "$body" "$branch" "$base")
curl -u "$user" "https://api.github.com/repos/$project/pulls" -d "$body"