Skip to content

Commit 3d12f03

Browse files
committed
build: create a git branch on tag checkout
1 parent 94c99de commit 3d12f03

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

nginx-build-msys2.sh

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ echo $OPENSSL
4040

4141
# clone and patch nginx
4242
if [[ -d nginx ]]; then
43-
cd nginx
43+
cd nginx || exit 1
4444
git checkout master
4545
git branch patch -D
4646
if [[ "${NGINX_TAG}" == "" ]]; then
@@ -52,11 +52,15 @@ if [[ -d nginx ]]; then
5252
else
5353
if [[ "${NGINX_TAG}" == "" ]]; then
5454
git clone https://github.com/nginx/nginx.git --depth=1
55+
cd nginx || exit 1
5556
else
5657
git clone https://github.com/nginx/nginx.git --depth=1 --branch "${NGINX_TAG}"
58+
cd nginx || exit 1
59+
# You are in 'detached HEAD' state.
60+
git checkout -b master
5761
fi
58-
cd nginx
5962
fi
63+
6064
git checkout -b patch
6165
git am -3 ../nginx-*.patch
6266

0 commit comments

Comments
 (0)