summaryrefslogtreecommitdiffstats
path: root/scripts/create-pull-request
diff options
context:
space:
mode:
Diffstat (limited to 'scripts/create-pull-request')
-rwxr-xr-xscripts/create-pull-request20
1 files changed, 6 insertions, 14 deletions
diff --git a/scripts/create-pull-request b/scripts/create-pull-request
index 3ce03d6c1a..762828fd9a 100755
--- a/scripts/create-pull-request
+++ b/scripts/create-pull-request
@@ -123,20 +123,12 @@ fi
123 123
124# Rewrite private URLs to public URLs 124# Rewrite private URLs to public URLs
125# Determine the repository name for use in the WEB_URL later 125# Determine the repository name for use in the WEB_URL later
126case "$REMOTE_URL" in 126USER_RE="[A-Za-z0-9_.@][A-Za-z0-9_.@-]*\$\?"
127*@*) 127PROTO_RE="[a-z][a-z+]*://"
128 USER_RE="[A-Za-z0-9_.@][A-Za-z0-9_.@-]*\$\?" 128GIT_RE="\(^\($PROTO_RE\)\?\)\($USER_RE@\)\?\([^:/]*\)[:/]\(.*\)"
129 PROTO_RE="[a-z][a-z+]*://" 129REMOTE_URL=${REMOTE_URL%.git}
130 GIT_RE="\(^\($PROTO_RE\)\?$USER_RE@\)\([^:/]*\)[:/]\(.*\)" 130REMOTE_REPO=$(echo $REMOTE_URL | sed "s#$GIT_RE#\5#")
131 REMOTE_URL=${REMOTE_URL%.git} 131REMOTE_URL=$(echo $REMOTE_URL | sed "s#$GIT_RE#git://\4/\5#")
132 REMOTE_REPO=$(echo $REMOTE_URL | sed "s#$GIT_RE#\4#")
133 REMOTE_URL=$(echo $REMOTE_URL | sed "s#$GIT_RE#git://\3/\4#")
134 ;;
135*)
136 echo "WARNING: Unrecognized remote URL: $REMOTE_URL"
137 echo " The pull and browse URLs will likely be incorrect"
138 ;;
139esac
140 132
141if [ -z "$BRANCH" ]; then 133if [ -z "$BRANCH" ]; then
142 BRANCH=$(git branch | grep -e "^\* " | cut -d' ' -f2) 134 BRANCH=$(git branch | grep -e "^\* " | cut -d' ' -f2)