diff options
author | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-11-01 10:02:08 +0300 |
---|---|---|
committer | Patrick Steinhardt <psteinhardt@gitlab.com> | 2021-11-08 17:48:45 +0300 |
commit | c469c87034f11689d47f026c464144d92a6a786a (patch) | |
tree | 05bb278c1ff5cb9aa2fb2eddb78006ac4fe59457 | |
parent | dbf5c9d381a346a6e4174e49e2b22cd9a8a78acb (diff) |
catfile: Move together object struct and its receiver functions
Move together the objecct struct and its receiver functions to make it
easier to see which structs and functions belong together.
-rw-r--r-- | internal/git/catfile/object_reader.go | 20 |
1 files changed, 10 insertions, 10 deletions
diff --git a/internal/git/catfile/object_reader.go b/internal/git/catfile/object_reader.go index b2568a78e..98654f393 100644 --- a/internal/git/catfile/object_reader.go +++ b/internal/git/catfile/object_reader.go @@ -111,16 +111,6 @@ func (o *objectReader) isDirty() bool { return o.n > 1 } -// Object represents data returned by `git cat-file --batch` -type Object struct { - // ObjectInfo represents main information about object - ObjectInfo - // parent is the objectReader which has created the Object. - parent *objectReader - // dataReader is reader which has all the object data. - dataReader io.LimitedReader -} - func (o *objectReader) Object( ctx context.Context, revision git.Revision, @@ -165,6 +155,16 @@ func (o *objectReader) Object( }, nil } +// Object represents data returned by `git cat-file --batch` +type Object struct { + // ObjectInfo represents main information about object + ObjectInfo + // parent is the objectReader which has created the Object. + parent *objectReader + // dataReader is reader which has all the object data. + dataReader io.LimitedReader +} + func (o *Object) Read(p []byte) (int, error) { o.parent.Lock() defer o.parent.Unlock() |