aboutsummaryrefslogtreecommitdiffstats
path: root/repository_test.go
diff options
context:
space:
mode:
Diffstat (limited to 'repository_test.go')
-rw-r--r--repository_test.go21
1 files changed, 21 insertions, 0 deletions
diff --git a/repository_test.go b/repository_test.go
index 8ac3d9e..b8f57cd 100644
--- a/repository_test.go
+++ b/repository_test.go
@@ -118,6 +118,27 @@ func (s *RepositorySuite) TestClone(c *C) {
c.Assert(branch.Hash().String(), Equals, "6ecf0ef2c2dffb796033e5a02219af86ec6584e5")
}
+func (s *RepositorySuite) TestCloneConfig(c *C) {
+ r := NewMemoryRepository()
+
+ head, err := r.Head()
+ c.Assert(err, Equals, plumbing.ErrReferenceNotFound)
+ c.Assert(head, IsNil)
+
+ err = r.Clone(&CloneOptions{
+ URL: s.GetBasicLocalRepositoryURL(),
+ })
+
+ c.Assert(err, IsNil)
+
+ cfg, err := r.Config()
+ c.Assert(err, IsNil)
+
+ c.Assert(cfg.Core.IsBare, Equals, true)
+ c.Assert(cfg.Remotes, HasLen, 1)
+ c.Assert(cfg.Remotes["origin"].Name, Equals, "origin")
+ c.Assert(cfg.Remotes["origin"].URL, Not(Equals), "")
+}
func (s *RepositorySuite) TestCloneNonEmpty(c *C) {
r := NewMemoryRepository()