diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2018-12-04 13:43:21 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-12-04 13:43:21 +0100 |
commit | 443abf89696c62d46e0c3e567c8ba380ff974d0d (patch) | |
tree | f7aa2fc1c67af06a0ff5f53c9fef3fc46f303780 /plumbing/format/packfile/common.go | |
parent | 8f52c5099e7fe4a2519920a7bbf5a9bb52ff9cec (diff) | |
parent | a4278c1c081578055c1e4df96aef54257729a100 (diff) | |
download | go-git-443abf89696c62d46e0c3e567c8ba380ff974d0d.tar.gz |
Merge pull request #1031 from jfontan/fix/error-fetching
git: return better error message when packfile cannot be downloaded
Diffstat (limited to 'plumbing/format/packfile/common.go')
-rw-r--r-- | plumbing/format/packfile/common.go | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/plumbing/format/packfile/common.go b/plumbing/format/packfile/common.go index 2b4aceb..0d9ed54 100644 --- a/plumbing/format/packfile/common.go +++ b/plumbing/format/packfile/common.go @@ -51,7 +51,13 @@ func WritePackfileToObjectStorage( } defer ioutil.CheckClose(w, &err) - _, err = io.Copy(w, packfile) + + var n int64 + n, err = io.Copy(w, packfile) + if err == nil && n == 0 { + return ErrEmptyPackfile + } + return err } |