Skip to content

Commit a1ea5d3

Browse files
committed
storage/filesystem: dotgit, Reproduce packfile parse error. Fixes src-d#1149
1 parent 24de5ef commit a1ea5d3

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

storage/filesystem/dotgit/dotgit_test.go

+6-1
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ import (
1414

1515
. "gopkg.in/check.v1"
1616
"gopkg.in/src-d/go-billy.v4/osfs"
17-
"gopkg.in/src-d/go-git-fixtures.v3"
17+
fixtures "gopkg.in/src-d/go-git-fixtures.v3"
1818
)
1919

2020
func Test(t *testing.T) { TestingT(t) }
@@ -463,6 +463,11 @@ func testObjectPacks(c *C, fs billy.Filesystem, dir *DotGit, f *fixtures.Fixture
463463
c.Assert(err, IsNil)
464464
err = badFile.Close()
465465
c.Assert(err, IsNil)
466+
// temporary file generated by git gc
467+
tmpFile, err := fs.Create("objects/pack/.tmp-11111-pack-58rf8y4wm1b1k52bpe0kdlx6lpreg6ahso8n3ylc.pack")
468+
c.Assert(err, IsNil)
469+
err = tmpFile.Close()
470+
c.Assert(err, IsNil)
466471

467472
hashes2, err := dir.ObjectPacks()
468473
c.Assert(err, IsNil)

0 commit comments

Comments
 (0)