~nilium/mtar

2c7c0fc8cfb7bf7e9a9a6b3ff494b61ba2428a4c — Noel Cower 6 years ago 6f36c4f v1.0.0
Fix double-recording of recursively-added dirs

Previously, if you added a directory, the directory header would be
written once, and then written again during the file walk stage.

Change-Id: I111e720e2c449411759fffff7808a0871d06b4ac
1 files changed, 1 insertions(+), 1 deletions(-)

M mtar.go
M mtar.go => mtar.go +1 -1
@@ 444,7 444,7 @@ func addRecursive(w *tar.Writer, src, prefix string, opts *FileOpts) {
	src = strings.TrimRight(src, "/")
	src = filepath.Clean(src) + "/"
	filepath.Walk(src, func(p string, info os.FileInfo, err error) error {
		if info.IsDir() {
		if info.IsDir() && !strings.HasSuffix(p, "/") {
			p += "/"
		}
		if p == src || shouldSkip(skipSrcGlobs, p) {