aboutsummaryrefslogtreecommitdiffstats
path: root/storage
diff options
context:
space:
mode:
authorAlexander Block <ablock84@gmail.com>2024-04-02 11:31:17 +0200
committerAlexander Block <ablock84@gmail.com>2024-04-05 23:35:33 +0200
commit7bd40f548987b3f0ce544902b9c4fbdf8d310882 (patch)
treeaa205a898b67f9a6a65267faff42d65e2d234cb1 /storage
parent7a9304e5a194f193cf413507fa1682ea97cc5216 (diff)
downloadgo-git-7bd40f548987b3f0ce544902b9c4fbdf8d310882.tar.gz
plumbing: Properly detect EOF when reading index extensions
Before this, go-git was relying on the peeked header to not include a valid 4 char string header. While doing this, it did not differentiate between the errournously read final hash and an unknown extension. This made it impossible to properly skip unknown optional extensions while detecting EOF early enough.
Diffstat (limited to 'storage')
-rw-r--r--storage/filesystem/index.go2
1 files changed, 1 insertions, 1 deletions
diff --git a/storage/filesystem/index.go b/storage/filesystem/index.go
index a19176f..a86ef3e 100644
--- a/storage/filesystem/index.go
+++ b/storage/filesystem/index.go
@@ -48,7 +48,7 @@ func (s *IndexStorage) Index() (i *index.Index, err error) {
defer ioutil.CheckClose(f, &err)
- d := index.NewDecoder(bufio.NewReader(f))
+ d := index.NewDecoder(f)
err = d.Decode(idx)
return idx, err
}