diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2017-02-12 23:03:47 +0100 |
---|---|---|
committer | Máximo Cuadros <mcuadros@gmail.com> | 2017-02-12 23:04:00 +0100 |
commit | b3b6e51565dcdbf81546f1d8f0121874a4e4fce9 (patch) | |
tree | 5ad244f4b9c350367ed65d57d8881078aefe0753 /repository_test.go | |
parent | 498dbf7dc92e288641f1af1acc52704150e8a6c0 (diff) | |
download | go-git-b3b6e51565dcdbf81546f1d8f0121874a4e4fce9.tar.gz |
submodule init implementation
Diffstat (limited to 'repository_test.go')
-rw-r--r-- | repository_test.go | 18 |
1 files changed, 4 insertions, 14 deletions
diff --git a/repository_test.go b/repository_test.go index 1b5b345..9fd48fc 100644 --- a/repository_test.go +++ b/repository_test.go @@ -516,26 +516,21 @@ func (s *RepositorySuite) TestPullProgress(c *C) { } func (s *RepositorySuite) TestPullAdd(c *C) { - path := fixtures.Basic().One().Worktree().Base() + path := fixtures.Basic().ByTag("worktree").One().Worktree().Base() - r, _ := Init(memory.NewStorage(), nil) - err := r.clone(&CloneOptions{ + r, err := Clone(memory.NewStorage(), nil, &CloneOptions{ URL: fmt.Sprintf("file://%s", filepath.Join(path, ".git")), }) c.Assert(err, IsNil) storage := r.Storer.(*memory.Storage) - c.Assert(storage.Objects, HasLen, 31) + c.Assert(storage.Objects, HasLen, 28) branch, err := r.Reference("refs/heads/master", false) c.Assert(err, IsNil) c.Assert(branch.Hash().String(), Equals, "6ecf0ef2c2dffb796033e5a02219af86ec6584e5") - branch, err = r.Reference("refs/remotes/origin/branch", false) - c.Assert(err, IsNil) - c.Assert(branch.Hash().String(), Equals, "e8d3ffab552895c19b9fcf7aa264d277cde33881") - ExecuteOnPath(c, path, "touch foo", "git add foo", @@ -546,16 +541,11 @@ func (s *RepositorySuite) TestPullAdd(c *C) { c.Assert(err, IsNil) // the commit command has introduced a new commit, tree and blob - c.Assert(storage.Objects, HasLen, 34) + c.Assert(storage.Objects, HasLen, 31) branch, err = r.Reference("refs/heads/master", false) c.Assert(err, IsNil) c.Assert(branch.Hash().String(), Not(Equals), "6ecf0ef2c2dffb796033e5a02219af86ec6584e5") - - // the commit command, was in the local branch, so the remote should be read ok - branch, err = r.Reference("refs/remotes/origin/branch", false) - c.Assert(err, IsNil) - c.Assert(branch.Hash().String(), Equals, "e8d3ffab552895c19b9fcf7aa264d277cde33881") } func (s *RepositorySuite) TestPushToEmptyRepository(c *C) { |