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

Commit 8cf7edb

Browse files
committed
dotgit: fix object delete test
Signed-off-by: Santiago M. Mola <[email protected]>
1 parent ae55016 commit 8cf7edb

File tree

1 file changed

+18
-14
lines changed

1 file changed

+18
-14
lines changed

storage/filesystem/dotgit/dotgit_test.go

+18-14
Original file line numberDiff line numberDiff line change
@@ -9,11 +9,11 @@ import (
99
"strings"
1010
"testing"
1111

12-
fixtures "gopkg.in/src-d/go-git-fixtures.v3"
1312
"gopkg.in/src-d/go-git.v4/plumbing"
1413

1514
. "gopkg.in/check.v1"
1615
"gopkg.in/src-d/go-billy.v4/osfs"
16+
"gopkg.in/src-d/go-git-fixtures.v3"
1717
)
1818

1919
func Test(t *testing.T) { TestingT(t) }
@@ -571,19 +571,23 @@ func (s *SuiteDotGit) TestObjectDelete(c *C) {
571571
hash := plumbing.NewHash("03db8e1fbe133a480f2867aac478fd866686d69e")
572572
err := dir.ObjectDelete(hash)
573573
c.Assert(err, IsNil)
574-
//incomingHash := "9d25e0f9bde9f82882b49fe29117b9411cb157b7" //made up hash
575-
//incomingDirPath := fs.Join("objects", "incoming-123456")
576-
//incomingSubDirPath := fs.Join(incomingDirPath, incomingHash[0:2])
577-
//incomingFilePath := fs.Join(incomingDirPath, incomingHash[2:40])
578-
//err = fs.MkdirAll(incomingDirPath, os.FileMode(0755))
579-
//c.Assert(err, IsNil)
580-
//err = fs.MkdirAll(incomingSubDirPath, os.FileMode(0755))
581-
//c.Assert(err, IsNil)
582-
//_, err = fs.Create(incomingFilePath)
583-
//c.Assert(err, IsNil)
584-
585-
//err = dir.ObjectDelete(plumbing.NewHash(incomingHash))
586-
//c.Assert(err, IsNil)
574+
575+
incomingHash := "9d25e0f9bde9f82882b49fe29117b9411cb157b7" //made up hash
576+
incomingDirPath := fs.Join("objects", "incoming-123456")
577+
incomingSubDirPath := fs.Join(incomingDirPath, incomingHash[0:2])
578+
incomingFilePath := fs.Join(incomingSubDirPath, incomingHash[2:40])
579+
580+
err = fs.MkdirAll(incomingSubDirPath, os.FileMode(0755))
581+
c.Assert(err, IsNil)
582+
583+
f, err := fs.Create(incomingFilePath)
584+
c.Assert(err, IsNil)
585+
586+
err = f.Close()
587+
c.Assert(err, IsNil)
588+
589+
err = dir.ObjectDelete(plumbing.NewHash(incomingHash))
590+
c.Assert(err, IsNil)
587591
}
588592

589593
func (s *SuiteDotGit) TestObjectNotFound(c *C) {

0 commit comments

Comments
 (0)