Skip to content
This repository was archived by the owner on Sep 11, 2020. It is now read-only.

Commit e6ff7f6

Browse files
committed
storage: dotgit, fix test not closing files
1 parent 8210c82 commit e6ff7f6

File tree

3 files changed

+7
-3
lines changed

3 files changed

+7
-3
lines changed

plumbing/transport/file/server_test.go

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@ package file
33
import (
44
"os"
55
"os/exec"
6+
"time"
67

78
"github.com/src-d/go-git-fixtures"
89

@@ -34,6 +35,11 @@ func (s *ServerSuite) SetUpSuite(c *C) {
3435
c.Assert(cmd.Run(), IsNil)
3536
}
3637

38+
func (s *ServerSuite) TearDownSuite(c *C) {
39+
time.Sleep(time.Millisecond * 200)
40+
s.CommonSuite.TearDownSuite(c)
41+
}
42+
3743
func (s *ServerSuite) TestPush(c *C) {
3844
// git <2.0 cannot push to an empty repository without a refspec.
3945
cmd := exec.Command("git", "push",

plumbing/transport/server/loader.go

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,8 +5,6 @@ import (
55
"gopkg.in/src-d/go-git.v4/plumbing/transport"
66
"gopkg.in/src-d/go-git.v4/storage/filesystem"
77

8-
"fmt"
9-
108
"gopkg.in/src-d/go-billy.v3"
119
"gopkg.in/src-d/go-billy.v3/osfs"
1210
)
@@ -42,7 +40,6 @@ func (l *fsLoader) Load(ep transport.Endpoint) (storer.Storer, error) {
4240
}
4341

4442
if _, err := fs.Stat("config"); err != nil {
45-
fmt.Println(ep.Path(), err)
4643
return nil, transport.ErrRepositoryNotFound
4744
}
4845

storage/filesystem/internal/dotgit/dotgit_test.go

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -373,6 +373,7 @@ func (s *SuiteDotGit) TestObjectPackIdx(c *C) {
373373
idx, err := dir.ObjectPackIdx(f.PackfileHash)
374374
c.Assert(err, IsNil)
375375
c.Assert(filepath.Ext(idx.Name()), Equals, ".idx")
376+
c.Assert(idx.Close(), IsNil)
376377
}
377378

378379
func (s *SuiteDotGit) TestObjectPackNotFound(c *C) {

0 commit comments

Comments
 (0)