Skip to content

Commit d369463

Browse files
committed
Don't set protected branches in global configuration
By default, the `master` branch is protected even if the protected branches were not configured. So, if a user doesn't run any configuration, the `master` branch will be protected. If a user wants to protect some other branch in the current (some) repository, then the `acquire-repository` has to be executed - sets the protected branches. So, there is no sense to configure protected branches during the global configuration (`acquire-git`).
1 parent 9937da5 commit d369463

4 files changed

Lines changed: 4 additions & 6 deletions

File tree

docs/configuration.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ if you `acquire-repository`, it proposes defaults that are set by `acquire-git`.
3333
1. setting your full name usign `user.name` [`b`]
3434
2. setting your email usign `user.email` [`b`]
3535
3. setting a default editor using `core.editor` [`b`]
36-
4. setting protected branches using `elegant-git.protected-branches` [`b`]
36+
4. setting protected branches using `elegant-git.protected-branches` [`l`]
3737

3838
# Level: Standards
3939

libexec/git-elegant-acquire-git

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -79,8 +79,7 @@ MESSAGE
7979
basics-configuration --global -- \
8080
user_name \
8181
user_email \
82-
core_editor \
83-
protected_branches
82+
core_editor
8483
standards-configuration --global \
8584
core_comment \
8685
apply_whitespace \

tests/git-elegant-acquire-git.bats

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,8 @@ teardown() {
3030
[[ ${lines[@]} =~ "==>> git config --global user.email elegant-git@example.com" ]]
3131
[[ ${lines[@]} =~ "What is the command to launching an editor? {vi}: " ]]
3232
[[ ${lines[@]} =~ "==>> git config --global core.editor vi" ]]
33-
[[ ${lines[@]} =~ "What are protected branches (split with space)?" ]]
34-
[[ ${lines[@]} =~ "==>> git config --global elegant-git.protected-branches master" ]]
33+
[[ ! ${lines[@]} =~ "What are protected branches (split with space)?" ]]
34+
[[ ! ${lines[@]} =~ "==>> git config --global elegant-git.protected-branches master" ]]
3535
}
3636

3737
@test "'acquire-git': standards are configured as expected on Windows" {

workflows

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,6 @@ repository() {
3434
git config --global user.name \"Elegant Git\"
3535
git config --global user.email elegant.git@email.com
3636
git config --global core.editor vi
37-
git config --global elegant-git.protected-branches master
3837
git config --global elegant-git.acquired true
3938
./install.bash /usr/local src
4039
"

0 commit comments

Comments
 (0)