From 3973da9b81fb83b9d005b9c7c18c0159e2b389d8 Mon Sep 17 00:00:00 2001 From: Stephen Chung Date: Sun, 21 Aug 2016 15:41:28 -0400 Subject: [PATCH] tar: remove completed TODO's and dead code minor clean-up of some comments and code that is not used in tar functionality Signed-off-by: Stephen Chung --- tar.go | 27 --------------------------- 1 file changed, 27 deletions(-) diff --git a/tar.go b/tar.go index 1d63dbe..0225b8b 100644 --- a/tar.go +++ b/tar.go @@ -145,7 +145,6 @@ func (ts *tarStream) readHeaders() { if hdr.FileInfo().IsDir() && keyword == "size" { continue } - // TODO: handle hardlinks val, err := keyFunc(hdr.Name, hdr.FileInfo(), tmpFile) if err != nil { ts.setErr(err) @@ -218,13 +217,11 @@ func populateTree(root, e *Entry, hdr *tar.Header) error { // directory up until the actual file wd = filepath.Dir(wd) if wd == "." { - // If file in root directory, no need to traverse down, just append root.Children = append([]*Entry{e}, root.Children...) e.Parent = root return nil } } - // TODO: what about directory/file names with "/" in it? dirNames := strings.Split(wd, "/") parent := root for _, name := range dirNames[:] { @@ -422,30 +419,6 @@ func setDifference(this, that []string) []string { return diff } -type relationship int - -const ( - unknownDir relationship = iota - sameDir - childDir - parentDir -) - -func compareDir(curDir, prevDir string) relationship { - curDir = filepath.Clean(curDir) - prevDir = filepath.Clean(prevDir) - if curDir == prevDir { - return sameDir - } - if filepath.Dir(curDir) == prevDir { - return childDir - } - if curDir == filepath.Dir(prevDir) { - return parentDir - } - return unknownDir -} - func (ts *tarStream) setErr(err error) { ts.err = err }