diff options
author | Máximo Cuadros <mcuadros@gmail.com> | 2017-08-10 14:17:56 +0200 |
---|---|---|
committer | GitHub <noreply@github.com> | 2017-08-10 14:17:56 +0200 |
commit | 773841734e11f0f607f6b047235f8527d475538f (patch) | |
tree | 6b437c0b94fa92cb88207eed2bcd04ac397e07bd /storage/filesystem/internal/dotgit/writers.go | |
parent | 91868d15053f29fa93c1984c7cf9bd961b6ab13d (diff) | |
parent | 94f43de99c66883bd930fce9581971b3893da610 (diff) | |
download | go-git-773841734e11f0f607f6b047235f8527d475538f.tar.gz |
Merge pull request #543 from erizocosmico/fix/packwriter-unused-notify
prevent PackWriter from using Notify if nothing was written
Diffstat (limited to 'storage/filesystem/internal/dotgit/writers.go')
-rw-r--r-- | storage/filesystem/internal/dotgit/writers.go | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/storage/filesystem/internal/dotgit/writers.go b/storage/filesystem/internal/dotgit/writers.go index a7525d4..46d3619 100644 --- a/storage/filesystem/internal/dotgit/writers.go +++ b/storage/filesystem/internal/dotgit/writers.go @@ -92,7 +92,7 @@ func (w *PackWriter) Write(p []byte) (int, error) { // was written, the tempfiles are deleted without writing a packfile. func (w *PackWriter) Close() error { defer func() { - if w.Notify != nil { + if w.Notify != nil && w.index != nil && w.index.Size() > 0 { w.Notify(w.checksum, w.index) } |