diff options
author | Jean-Sébastien Pédron <[email protected]> | 2025-06-30 18:10:05 +0200 |
---|---|---|
committer | Jean-Sébastien Pédron <[email protected]> | 2025-07-22 12:52:42 +0200 |
commit | c01dfaf1968f0b982e6772da0750ec8f88c04e9b (patch) | |
tree | e2f33ce5dccd1cff8bbcac7606d338ae5c672716 | |
parent | f157f1121a89ea766293df3a31c58e50c4009d16 (diff) | |
download | erlang.mk-c01dfaf1968f0b982e6772da0750ec8f88c04e9b.tar.gz erlang.mk-c01dfaf1968f0b982e6772da0750ec8f88c04e9b.tar.bz2 erlang.mk-c01dfaf1968f0b982e6772da0750ec8f88c04e9b.zip |
test: Set the branch name in `git init`
If the user running the tests has set `init.defaultBranch` to something
else in their `.gitconfig`, the tests won't have the expected branch
name.
This patch explicitly sets the branch name to make sure the tests are
not affected by a user setting.
-rw-r--r-- | test/core_app.mk | 2 | ||||
-rw-r--r-- | test/core_deps.mk | 16 | ||||
-rw-r--r-- | test/core_plugins.mk | 10 |
3 files changed, 14 insertions, 14 deletions
diff --git a/test/core_app.mk b/test/core_app.mk index 7c9c046..138c68d 100644 --- a/test/core_app.mk +++ b/test/core_app.mk @@ -235,7 +235,7 @@ core-app-auto-git-id: init $i "Make it a git repository" $t cd $(APP) && \ - git init -q && \ + git init -q -b master && \ git config user.email "[email protected]" && \ git config user.name "test suite" && \ git add . && \ diff --git a/test/core_deps.mk b/test/core_deps.mk index dd052e5..ace58c9 100644 --- a/test/core_deps.mk +++ b/test/core_deps.mk @@ -624,7 +624,7 @@ core-deps-fetch-git-subfolder: init # Create an empty file so src/ gets committed. $t touch $(APP)/git_repo/my_dep/src/README $t cd $(APP)/git_repo && \ - git init -q && \ + git init -q -b master && \ git config user.email "[email protected]" && \ git config user.name "test suite" && \ git add . && \ @@ -665,7 +665,7 @@ core-deps-fetch-git-submodule: init # Create an empty file so src/ gets committed. $t touch $(APP)/my_dep/src/README $t cd $(APP)/my_dep && \ - git init -q && \ + git init -q -b master && \ git config user.email "[email protected]" && \ git config user.name "test suite" && \ git add . && \ @@ -674,7 +674,7 @@ core-deps-fetch-git-submodule: init $i "Add the submodule to my_dep" $t mkdir $(APP)/deps $t cd $(APP) && \ - git init -q && \ + git init -q -b master && \ git -c protocol.file.allow=always submodule -q add file://$(abspath $(APP)/my_dep) deps/my_dep && \ git config user.email "[email protected]" && \ git config user.name "test suite" && \ @@ -870,7 +870,7 @@ define add_dep_and_subdep $i "Create a Git repository for $(APP)_$(1)subdep" $t (cd $(APP)_$(1)subdep && \ - git init -q && \ + git init -q -b master && \ git config user.name "Testsuite" && \ git config user.email "[email protected]" && \ git add . && \ @@ -889,7 +889,7 @@ define add_dep_and_subdep $i "Create a Git repository for $(APP)_$(1)dep" $t (cd $(APP)_$(1)dep && \ - git init -q && \ + git init -q -b master && \ git config user.name "Testsuite" && \ git config user.email "[email protected]" && \ git add . && \ @@ -928,7 +928,7 @@ dep_shelldep = git file://$(abspath $(APP)_shelldep) master\ $i "Create a Git repository for $(APP)" $t (cd $(APP) && \ - git init -q && \ + git init -q -b master && \ git config user.name "Testsuite" && \ git config user.email "[email protected]" && \ git add . && \ @@ -1033,7 +1033,7 @@ dep_dep = git file://$(abspath $(APP)_dep) master\ $i "Create a Git repository for $(APP)" $t (cd $(APP) && \ - git init -q && \ + git init -q -b master && \ git config user.name "Testsuite" && \ git config user.email "[email protected]" && \ git add . && \ @@ -1079,7 +1079,7 @@ dep_dep = git file://$(abspath $(APP)_dep) master\ $i "Create a Git repository for $(APP)" $t (cd $(APP) && \ - git init -q && \ + git init -q -b master && \ git config user.name "Testsuite" && \ git config user.email "[email protected]" && \ git add . && \ diff --git a/test/core_plugins.mk b/test/core_plugins.mk index 8544945..76e2899 100644 --- a/test/core_plugins.mk +++ b/test/core_plugins.mk @@ -23,7 +23,7 @@ core-plugins-all: init # We check that overriding THIS doesn't cause an error. $t echo "THIS :=" >> $(APP)/plugin_dep/plugins.mk $t cd $(APP)/plugin_dep && \ - git init -q && \ + git init -q -b master && \ git config user.email "[email protected]" && \ git config user.name "test suite" && \ git add . && \ @@ -168,7 +168,7 @@ core-plugins-one: init # We check that overriding THIS doesn't cause an error. $t echo "THIS :=" >> $(APP)/plugin_dep/plugins.mk $t cd $(APP)/plugin_dep && \ - git init -q && \ + git init -q -b master && \ git config user.email "[email protected]" && \ git config user.name "test suite" && \ git add . && \ @@ -197,7 +197,7 @@ core-plugins-templates: init "-module(template_name)." \ "endef" > $(APP)/plugin_dep/plugins.mk $t cd $(APP)/plugin_dep && \ - git init -q && \ + git init -q -b master && \ git config user.email "[email protected]" && \ git config user.name "test suite" && \ git add . && \ @@ -238,7 +238,7 @@ core-plugins-templates-apps-only: init "-module(test_mk)." \ "endef" > $(APP)/plugin_dep/plugins.mk $t cd $(APP)/plugin_dep && \ - git init -q && \ + git init -q -b master && \ git config user.email "[email protected]" && \ git config user.name "test suite" && \ git add . && \ @@ -276,7 +276,7 @@ core-plugins-templates-file: init $t echo "THIS := \$$(dir \$$(realpath \$$(lastword \$$(MAKEFILE_LIST))))" > $(APP)/plugin_dep/plugins.mk $t printf "%s\n" "tpl_test_mk = \$$(file < \$$(THIS)/templates/test_mk.erl)" >> $(APP)/plugin_dep/plugins.mk $t cd $(APP)/plugin_dep && \ - git init -q && \ + git init -q -b master && \ git config user.email "[email protected]" && \ git config user.name "test suite" && \ git add . && \ |