diff options
author | ZauberNerd <zaubernerd@zaubernerd.de> | 2022-03-15 17:02:30 +0000 |
---|---|---|
committer | ZauberNerd <zaubernerd@zaubernerd.de> | 2023-03-23 19:49:00 +0100 |
commit | cdd1e5562d10c6bb19f979ca32f3ae7ef646024f (patch) | |
tree | bf1afc93f0245323589c5f8715718533c794b5b1 /plumbing/format/packfile/parser_test.go | |
parent | 3f1cfde283c93f33218c807602e93d47f72f7b90 (diff) | |
download | go-git-cdd1e5562d10c6bb19f979ca32f3ae7ef646024f.tar.gz |
plumbing: resolve non-external delta references
In a self-contained pack file delta references might point to base
objects stored later in the file.
In this case we need to replace placeholders for external refs with the
actual base object and update the children references.
Fixes: #484
Co-authored-by: Markus Wolf <mail@markus-wolf.de>
Diffstat (limited to 'plumbing/format/packfile/parser_test.go')
-rw-r--r-- | plumbing/format/packfile/parser_test.go | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/plumbing/format/packfile/parser_test.go b/plumbing/format/packfile/parser_test.go index 651d05f..b8d080f 100644 --- a/plumbing/format/packfile/parser_test.go +++ b/plumbing/format/packfile/parser_test.go @@ -147,6 +147,19 @@ func (s *ParserSuite) TestResolveExternalRefsInThinPack(c *C) { c.Assert(err, IsNil) } +func (s *ParserSuite) TestResolveExternalRefs(c *C) { + extRefsThinPack := fixtures.ByTag("delta-before-base").One() + + scanner := packfile.NewScanner(extRefsThinPack.Packfile()) + + obs := new(testObserver) + parser, err := packfile.NewParser(scanner, obs) + c.Assert(err, IsNil) + + _, err = parser.Parse() + c.Assert(err, IsNil) +} + type observerObject struct { hash string otype plumbing.ObjectType |