aboutsummaryrefslogtreecommitdiffstats
path: root/repository_test.go
diff options
context:
space:
mode:
authorThinkChaos <ThinkChaos@users.noreply.github.com>2023-05-31 11:54:26 -0400
committerThinkChaos <ThinkChaos@users.noreply.github.com>2023-09-15 12:44:52 -0400
commit644929ade3ac7c07c370be8065fa2ac6faf081be (patch)
treebf76313751ced493b4c298725d6eeaf567c05872 /repository_test.go
parent1ad7d8dd024abca82779e2dfdff69d9712161ab8 (diff)
downloadgo-git-644929ade3ac7c07c370be8065fa2ac6faf081be.tar.gz
git: allow using `InitOptions` with `PlainInitWithOptions`
Diffstat (limited to 'repository_test.go')
-rw-r--r--repository_test.go13
1 files changed, 11 insertions, 2 deletions
diff --git a/repository_test.go b/repository_test.go
index bc6b188..3154f1d 100644
--- a/repository_test.go
+++ b/repository_test.go
@@ -523,14 +523,23 @@ func (s *RepositorySuite) TestPlainInitWithOptions(c *C) {
defer clean()
r, err := PlainInitWithOptions(dir, &PlainInitOptions{
- Bare: true,
+ InitOptions: InitOptions{
+ DefaultBranch: "refs/heads/foo",
+ },
+ Bare: false,
})
c.Assert(err, IsNil)
c.Assert(r, NotNil)
cfg, err := r.Config()
c.Assert(err, IsNil)
- c.Assert(cfg.Core.IsBare, Equals, true)
+ c.Assert(cfg.Core.IsBare, Equals, false)
+
+ createCommit(c, r)
+
+ ref, err := r.Head()
+ c.Assert(err, IsNil)
+ c.Assert(ref.Name().String(), Equals, "refs/heads/foo")
}
func (s *RepositorySuite) TestPlainInitAlreadyExists(c *C) {