diff options
author | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2022-02-10 02:52:01 +0100 |
---|---|---|
committer | Rafael G. Martins <rafael@rafaelmartins.eng.br> | 2022-02-10 02:52:19 +0100 |
commit | 8e74dace4b878027405c267670f559ff761f8ea6 (patch) | |
tree | 6475dd99fe888bcc9af32773b6e6ec3b60160d6f /tests/blogc-git-receiver/check_pre_receive.sh.in | |
parent | 06998bda19b6f9dd452a48ed12b61ca9df7dba23 (diff) | |
download | blogc-8e74dace4b878027405c267670f559ff761f8ea6.tar.gz blogc-8e74dace4b878027405c267670f559ff761f8ea6.tar.bz2 blogc-8e74dace4b878027405c267670f559ff761f8ea6.zip |
git-receiver: allow deploying from "main" branch
if a "main" branch is available and no "master" branch is available, use
it. "master" still takes precedence to avoid breaking old setups.
Diffstat (limited to 'tests/blogc-git-receiver/check_pre_receive.sh.in')
-rwxr-xr-x | tests/blogc-git-receiver/check_pre_receive.sh.in | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/tests/blogc-git-receiver/check_pre_receive.sh.in b/tests/blogc-git-receiver/check_pre_receive.sh.in index 9ac12df..2cf3c89 100755 --- a/tests/blogc-git-receiver/check_pre_receive.sh.in +++ b/tests/blogc-git-receiver/check_pre_receive.sh.in @@ -29,7 +29,7 @@ EOF cd "${TEMP}/repos/foo.git" SHELL="${SELF}" HOME="${TEMP}" GIT_DIR=. ${TESTS_ENVIRONMENT} ./hooks/pre-receive < "${TEMP}/payload.txt" 2>&1 | tee "${TEMP}/output.txt" -grep "warning: no reference to master branch found. nothing to deploy." "${TEMP}/output.txt" &> /dev/null +grep "warning: no suitable branch found. nothing to deploy." "${TEMP}/output.txt" &> /dev/null cat > "${TEMP}/tmp.txt" <<EOF blob @@ -55,7 +55,7 @@ git fast-import < "${TEMP}/tmp.txt" &> /dev/null cat > "${TEMP}/payload.txt" <<EOF 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 refs/heads/foo 0000000000000000000000000000000000000000 $(git rev-parse master) refs/heads/master -0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 refs/heads/bar +0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 refs/heads/main EOF SHELL="${SELF}" HOME="${TEMP}" GIT_DIR=. ${TESTS_ENVIRONMENT} ./hooks/pre-receive < "${TEMP}/payload.txt" 2>&1 | tee "${TEMP}/output.txt" @@ -73,8 +73,8 @@ all: mkdir -p \$(OUTPUT_DIR) echo lol > \$(OUTPUT_DIR)/foo.txt -reset refs/heads/master -commit refs/heads/master +reset refs/heads/main +commit refs/heads/main mark :2 author Rafael G. Martins <rafael@rafaelmartins.eng.br> 1476139736 +0200 committer Rafael G. Martins <rafael@rafaelmartins.eng.br> 1476139736 +0200 @@ -89,7 +89,7 @@ git fast-import < "${TEMP}/tmp.txt" &> /dev/null cat > "${TEMP}/payload.txt" <<EOF 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 refs/heads/foo -0000000000000000000000000000000000000000 $(git rev-parse master) refs/heads/master +0000000000000000000000000000000000000000 $(git rev-parse main) refs/heads/main 0000000000000000000000000000000000000000 0000000000000000000000000000000000000000 refs/heads/bar EOF |