fix: checkout the deploy branch when initializing a new repo

The initial-branch flag only works on newer versions of git - 2.28.0+ - and the init.defaultBranch config is otherwise also ignored until then.
This commit is contained in:
Jose Diaz-Gonzalez
2023-05-28 05:38:57 -04:00
parent 9f3879b225
commit 70a1b6a863

View File

@@ -30,6 +30,7 @@ trigger-git-git-from-directory() {
local DEPLOY_BRANCH="$(fn-git-deploy-branch "$APP")"
cp -rT "$SOURCECODE_WORK_DIR" "$TMP_WORK_DIR"
suppress_output fn-git-cmd "$TMP_WORK_DIR" init
suppress_output fn-git-cmd "$TMP_WORK_DIR" checkout -b "$DEPLOY_BRANCH"
suppress_output fn-git-cmd "$TMP_WORK_DIR" config init.defaultBranch "$DEPLOY_BRANCH"
suppress_output fn-git-cmd "$TMP_WORK_DIR" config user.name "$USER_NAME"
suppress_output fn-git-cmd "$TMP_WORK_DIR" config user.email "$USER_EMAIL"