diff options
Diffstat (limited to 'scripts/create-pull-request')
-rwxr-xr-x | scripts/create-pull-request | 20 |
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 |
126 | case "$REMOTE_URL" in | 126 | USER_RE="[A-Za-z0-9_.@][A-Za-z0-9_.@-]*\$\?" |
127 | *@*) | 127 | PROTO_RE="[a-z][a-z+]*://" |
128 | USER_RE="[A-Za-z0-9_.@][A-Za-z0-9_.@-]*\$\?" | 128 | GIT_RE="\(^\($PROTO_RE\)\?\)\($USER_RE@\)\?\([^:/]*\)[:/]\(.*\)" |
129 | PROTO_RE="[a-z][a-z+]*://" | 129 | REMOTE_URL=${REMOTE_URL%.git} |
130 | GIT_RE="\(^\($PROTO_RE\)\?$USER_RE@\)\([^:/]*\)[:/]\(.*\)" | 130 | REMOTE_REPO=$(echo $REMOTE_URL | sed "s#$GIT_RE#\5#") |
131 | REMOTE_URL=${REMOTE_URL%.git} | 131 | REMOTE_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 | ;; | ||
139 | esac | ||
140 | 132 | ||
141 | if [ -z "$BRANCH" ]; then | 133 | if [ -z "$BRANCH" ]; then |
142 | BRANCH=$(git branch | grep -e "^\* " | cut -d' ' -f2) | 134 | BRANCH=$(git branch | grep -e "^\* " | cut -d' ' -f2) |