diff options
Diffstat (limited to 'pkg/git/git.go')
-rw-r--r-- | pkg/git/git.go | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/pkg/git/git.go b/pkg/git/git.go index 591fafb..66338a1 100644 --- a/pkg/git/git.go +++ b/pkg/git/git.go @@ -255,15 +255,22 @@ func (g *GitRepository) WriteTar(w io.Writer, prefix string) error { } if !info.IsDir() { - c, err := g.FileContent(name) + file, err := tree.File(name) if err != nil { return err } - _, err = tw.Write([]byte(c)) + reader, err := file.Blob.Reader() if err != nil { return err } + + _, err = io.Copy(tw, reader) + if err != nil { + reader.Close() + return err + } + reader.Close() } } |