From 70a1b6a86341a2d73785ec7acfa19eb11e40390a Mon Sep 17 00:00:00 2001 From: Jose Diaz-Gonzalez Date: Sun, 28 May 2023 05:38:57 -0400 Subject: [PATCH] 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. --- plugins/git/git-from-directory | 1 + 1 file changed, 1 insertion(+) diff --git a/plugins/git/git-from-directory b/plugins/git/git-from-directory index 980d663e5..9f94568c5 100755 --- a/plugins/git/git-from-directory +++ b/plugins/git/git-from-directory @@ -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"