From 01f0ba9a433a6089524a9b9c51a4feb15eec8ca6 Mon Sep 17 00:00:00 2001 From: Yuichi Watanabe Date: Fri, 17 May 2019 13:53:17 +0900 Subject: [PATCH] storage/filesystem: dotgit, Reproduce packfile parse error. Fixes #1149 Signed-off-by: Yuichi Watanabe --- storage/filesystem/dotgit/dotgit_test.go | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/storage/filesystem/dotgit/dotgit_test.go b/storage/filesystem/dotgit/dotgit_test.go index 73b0291a7..4cda2f9e0 100644 --- a/storage/filesystem/dotgit/dotgit_test.go +++ b/storage/filesystem/dotgit/dotgit_test.go @@ -463,6 +463,11 @@ func testObjectPacks(c *C, fs billy.Filesystem, dir *DotGit, f *fixtures.Fixture c.Assert(err, IsNil) err = badFile.Close() c.Assert(err, IsNil) + // temporary file generated by git gc + tmpFile, err := fs.Create("objects/pack/.tmp-11111-pack-58rf8y4wm1b1k52bpe0kdlx6lpreg6ahso8n3ylc.pack") + c.Assert(err, IsNil) + err = tmpFile.Close() + c.Assert(err, IsNil) hashes2, err := dir.ObjectPacks() c.Assert(err, IsNil)