From c947623707a1858b219ef1cbfa87d102fcde1e42 Mon Sep 17 00:00:00 2001
From: Florian Weingarten <flo@hackvalue.de>
Date: Sat, 25 Apr 2015 15:40:42 -0400
Subject: [PATCH] Fix progress off-by-1

---
 archiver.go | 6 ++++--
 1 file changed, 4 insertions(+), 2 deletions(-)

diff --git a/archiver.go b/archiver.go
index fab11226f..fc5656d87 100644
--- a/archiver.go
+++ b/archiver.go
@@ -515,7 +515,7 @@ func (arch *Archiver) dirWorker(wg *sync.WaitGroup, p *Progress, done <-chan str
 				// if this is the top-level dir, only create a stub node
 				node = &Node{}
 			} else {
-				// else create note from path and fi
+				// else create node from path and fi
 				node, err = NodeFromFileInfo(dir.Path(), dir.Info())
 				if err != nil {
 					node.Error = err.Error()
@@ -534,7 +534,9 @@ func (arch *Archiver) dirWorker(wg *sync.WaitGroup, p *Progress, done <-chan str
 			node.blobs = Blobs{blob}
 
 			dir.Result() <- node
-			p.Report(Stat{Dirs: 1})
+			if dir.Path() != "" {
+				p.Report(Stat{Dirs: 1})
+			}
 		case <-done:
 			// pipeline was cancelled
 			return