diff options
author | Gabriel A. Giovanini <mail@gabrielgio.me> | 2024-06-23 16:32:41 +0200 |
---|---|---|
committer | Gabriel A. Giovanini <mail@gabrielgio.me> | 2024-06-23 16:32:41 +0200 |
commit | 6b96b76d66a929a2b428505809fda23a19005c63 (patch) | |
tree | ef653cddb1c45ff23581cd562a5990626d4129af /pkg/service | |
parent | e1664fcbc4685906d3dabc66bf947a17bce7efc0 (diff) | |
download | cerrado-6b96b76d66a929a2b428505809fda23a19005c63.tar.gz cerrado-6b96b76d66a929a2b428505809fda23a19005c63.tar.bz2 cerrado-6b96b76d66a929a2b428505809fda23a19005c63.zip |
fix: Fix bin file not being writen to tar
FileContent was not working for bin file (nor was meant to).
Moving to blob reader solves the issue.
Diffstat (limited to 'pkg/service')
-rw-r--r-- | pkg/service/git.go | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/pkg/service/git.go b/pkg/service/git.go index cbee90a..654d6ac 100644 --- a/pkg/service/git.go +++ b/pkg/service/git.go @@ -94,7 +94,7 @@ func (g *GitService) ListCommits(name, ref string, count int) ([]*object.Commit, return repo.Commits(count) } -func (g *GitService) WriteTarGZip(w io.Writer, name, ref string, filename string) error { +func (g *GitService) WriteTarGZip(w io.Writer, name, ref string, prefix string) error { r := g.configRepo.GetByName(name) if r == nil { return RepositoryNotFoundErr @@ -113,8 +113,12 @@ func (g *GitService) WriteTarGZip(w io.Writer, name, ref string, filename string gw := gzip.NewWriter(w) defer gw.Close() - return repo.WriteTar(gw, filename) + err = repo.WriteTar(gw, prefix) + if err != nil { + return err + } + return nil } func (g *GitService) GetTree(name, ref, path string) (*object.Tree, error) { |