From cd281e0c29e38cfe9dc523c3558ee71e8974608a Mon Sep 17 00:00:00 2001 From: Tim Waugh Date: Thu, 20 Sep 2018 11:19:03 +0100 Subject: [PATCH] Remove unused FileHashes.root Signed-off-by: Tim Waugh --- backvendor/filehash.go | 4 ---- backvendor/filehash_test.go | 4 ---- backvendor/git.go | 1 - 3 files changed, 9 deletions(-) diff --git a/backvendor/filehash.go b/backvendor/filehash.go index 5c3ec6a9..d6dab073 100644 --- a/backvendor/filehash.go +++ b/backvendor/filehash.go @@ -49,9 +49,6 @@ type FileHashes struct { // h is the Hasher used to create each FileHash h Hasher - // root is the top level directory - root string - // hashes maps a relative filename to its FileHash hashes map[string]FileHash } @@ -62,7 +59,6 @@ type FileHashes struct { func NewFileHashes(h Hasher, root string, excludes map[string]struct{}) (*FileHashes, error) { hashes := &FileHashes{ h: h, - root: root, hashes: make(map[string]FileHash), } root = path.Clean(root) diff --git a/backvendor/filehash_test.go b/backvendor/filehash_test.go index 3c0d1ca6..aeba0866 100644 --- a/backvendor/filehash_test.go +++ b/backvendor/filehash_test.go @@ -31,9 +31,6 @@ func TestNewFileHashes(t *testing.T) { if hashes == nil { t.Fatal("NewFileHashes returned nil map") } - if hashes.root != "testdata/gosource" { - t.Fatalf("Incorrect hashes.root (%s)", hashes.root) - } emptyhash := FileHash("e69de29bb2d1d6434b8b29ae775ad8c2e48c5391") expected := map[string]FileHash{ "ignored.go": emptyhash, @@ -104,7 +101,6 @@ func TestIsSubsetOf(t *testing.T) { other := &FileHashes{ h: hasher, - root: hashes.root, hashes: make(map[string]FileHash), } for k, v := range hashes.hashes { diff --git a/backvendor/git.go b/backvendor/git.go index 7b021522..c1d63e7c 100644 --- a/backvendor/git.go +++ b/backvendor/git.go @@ -165,7 +165,6 @@ func (g *gitWorkingTree) FileHashesFromRef(ref string) (*FileHashes, error) { } return &FileHashes{ h: hasher, - root: g.anyWorkingTree.Source.Path, hashes: fh, }, nil }