aboutsummaryrefslogtreecommitdiffstats
path: root/repository_test.go
diff options
context:
space:
mode:
authorMáximo Cuadros <mcuadros@gmail.com>2016-12-12 15:57:34 +0100
committerGitHub <noreply@github.com>2016-12-12 15:57:34 +0100
commit2dac5c1d1b6cb7d9a303a7346c3c7a3120d4ad40 (patch)
treef5f87cd723a0343e9744f2324ad1a8f1ff55bf90 /repository_test.go
parentdf9748cfb51db9c406e3df063badbd8c78ee819d (diff)
downloadgo-git-2dac5c1d1b6cb7d9a303a7346c3c7a3120d4ad40.tar.gz
config: Config, bare flag (#177)
* config.Config: bare flag * changes * changes
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()