Skip to content
This repository has been archived by the owner on Jun 6, 2022. It is now read-only.

Commit

Permalink
Remove unused FileHashes.root
Browse files Browse the repository at this point in the history
Signed-off-by: Tim Waugh <[email protected]>
  • Loading branch information
twaugh committed Sep 20, 2018
1 parent 0dbb2aa commit cd281e0
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 9 deletions.
4 changes: 0 additions & 4 deletions backvendor/filehash.go
Original file line number Diff line number Diff line change
Expand Up @@ -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
}
Expand All @@ -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)
Expand Down
4 changes: 0 additions & 4 deletions backvendor/filehash_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down Expand Up @@ -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 {
Expand Down
1 change: 0 additions & 1 deletion backvendor/git.go
Original file line number Diff line number Diff line change
Expand Up @@ -165,7 +165,6 @@ func (g *gitWorkingTree) FileHashesFromRef(ref string) (*FileHashes, error) {
}
return &FileHashes{
h: hasher,
root: g.anyWorkingTree.Source.Path,
hashes: fh,
}, nil
}
Expand Down

0 comments on commit cd281e0

Please sign in to comment.