summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorIan Jackson <ijackson@chiark.greenend.org.uk>2021-09-07 23:10:48 +0100
committerIan Jackson <ijackson@chiark.greenend.org.uk>2021-09-07 23:15:00 +0100
commitc22dcf7c82cc6cac60ba61e84e1d6331061c70cf (patch)
tree93df1bf5f7791b22dce8164cb4a9e78e9d2ccf2a
parent86f59a365b6f30820c15d356a23d7c6ae5946351 (diff)
git-playtree-setup: Handle init.defaultBranch
For now, we default to overriding this to "master" for the playtree. When this is widespread enough, callers will be able to set GIT_PLAYTREE_DEFAULT_BRANCH=main. When all do this we can make not setting that an error and then later we can get rid of it entirely. Closes: #972098 Signed-off-by: Ian Jackson <ijackson@chiark.greenend.org.uk>
-rwxr-xr-xgit-playtree-setup4
1 files changed, 3 insertions, 1 deletions
diff --git a/git-playtree-setup b/git-playtree-setup
index 184de4d..5ef5c18 100755
--- a/git-playtree-setup
+++ b/git-playtree-setup
@@ -7,6 +7,8 @@
# mkdir .git/some/play/thing
# cd .git/some/play/thing
# git-playtree-setup .
+#
+# Honours GIT_PLAYTREE_DEFAULT_BRANCH, which currently defaults to "master"
set -e${GIT_PLAYTREE_SETUP_DEBUG}
@@ -26,7 +28,7 @@ case "$gcd" in
*) gcd="../$gcd" ;;
esac
-git init -q
+git -c init.defaultBranch=${GIT_PLAYTREE_DEFAULT_BRANCH-master} init -q
git config gc.auto 0
unset_all () { git config --local --unset-all $key || [ $? = 5 ]; }