aboutsummaryrefslogtreecommitdiffstats
path: root/storage/filesystem/internal/dotgit/writers.go
diff options
context:
space:
mode:
authorMiguel Molina <miguel@erizocosmi.co>2017-08-10 13:15:41 +0200
committerMiguel Molina <miguel@erizocosmi.co>2017-08-10 13:15:41 +0200
commit94f43de99c66883bd930fce9581971b3893da610 (patch)
tree6b437c0b94fa92cb88207eed2bcd04ac397e07bd /storage/filesystem/internal/dotgit/writers.go
parent91868d15053f29fa93c1984c7cf9bd961b6ab13d (diff)
downloadgo-git-94f43de99c66883bd930fce9581971b3893da610.tar.gz
prevent PackWriter from using Notify if nothing was written
Signed-off-by: Miguel Molina <miguel@erizocosmi.co>
Diffstat (limited to 'storage/filesystem/internal/dotgit/writers.go')
-rw-r--r--storage/filesystem/internal/dotgit/writers.go2
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)
}