aboutsummaryrefslogtreecommitdiffstats
path: root/config/config_test.go
diff options
context:
space:
mode:
authorThomas Lazar <tlazar@signicast.com>2020-09-30 17:06:17 -0500
committerThomas Lazar <tlazar@signicast.com>2020-09-30 17:06:17 -0500
commitec9b50d84022215ba78983155a3c44b51ccd4f52 (patch)
treeb2feb4cb4b6c72960f8ba89bfee5a587d2a72549 /config/config_test.go
parent63d92533b538cb380667deee5dc6d32f0946c737 (diff)
downloadgo-git-ec9b50d84022215ba78983155a3c44b51ccd4f52.tar.gz
Add init.defaultBranch to the config
Diffstat (limited to 'config/config_test.go')
-rw-r--r--config/config_test.go6
1 files changed, 6 insertions, 0 deletions
diff --git a/config/config_test.go b/config/config_test.go
index 5a88c19..21fa1ee 100644
--- a/config/config_test.go
+++ b/config/config_test.go
@@ -46,6 +46,8 @@ func (s *ConfigSuite) TestUnmarshal(c *C) {
[branch "master"]
remote = origin
merge = refs/heads/master
+[init]
+ defaultBranch = main
`)
cfg := NewConfig()
@@ -77,6 +79,7 @@ func (s *ConfigSuite) TestUnmarshal(c *C) {
c.Assert(cfg.Submodules["qux"].Branch, Equals, "bar")
c.Assert(cfg.Branches["master"].Remote, Equals, "origin")
c.Assert(cfg.Branches["master"].Merge, Equals, plumbing.ReferenceName("refs/heads/master"))
+ c.Assert(cfg.Init.DefaultBranch, Equals, "main")
}
func (s *ConfigSuite) TestMarshal(c *C) {
@@ -99,12 +102,15 @@ func (s *ConfigSuite) TestMarshal(c *C) {
[branch "master"]
remote = origin
merge = refs/heads/master
+[init]
+ defaultBranch = main
`)
cfg := NewConfig()
cfg.Core.IsBare = true
cfg.Core.Worktree = "bar"
cfg.Pack.Window = 20
+ cfg.Init.DefaultBranch = "main"
cfg.Remotes["origin"] = &RemoteConfig{
Name: "origin",
URLs: []string{"git@github.com:mcuadros/go-git.git"},