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:
@@ -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"
|
||||
|
||||
Reference in New Issue
Block a user