From 40f4ce8108a8f2a844c2ea9a0d980154b7ddf990 Mon Sep 17 00:00:00 2001 From: Vincent Batts Date: Mon, 10 Dec 2018 11:26:12 -0500 Subject: [PATCH] check: remove unused TarCheck(), for Compare() Signed-off-by: Vincent Batts --- check.go | 10 ---------- tar_test.go | 8 ++++---- 2 files changed, 4 insertions(+), 14 deletions(-) diff --git a/check.go b/check.go index 29e05e3..5d60fff 100644 --- a/check.go +++ b/check.go @@ -18,13 +18,3 @@ func Check(root string, dh *DirectoryHierarchy, keywords []Keyword, fs FsEval) ( return Compare(dh, newDh, keywords) } - -// TarCheck is the tar equivalent of checking a file hierarchy spec against a -// tar stream to determine if files have been changed. This is precisely -// equivalent to Compare(dh, tarDH, keywords). -func TarCheck(tarDH, dh *DirectoryHierarchy, keywords []Keyword) ([]InodeDelta, error) { - if keywords == nil { - return Compare(dh, tarDH, dh.UsedKeywords()) - } - return Compare(dh, tarDH, keywords) -} diff --git a/tar_test.go b/tar_test.go index 4b88e51..82d8abe 100644 --- a/tar_test.go +++ b/tar_test.go @@ -109,7 +109,7 @@ func TestTar(t *testing.T) { t.Fatal(err) } - res, err := TarCheck(tdh, dh, append(DefaultKeywords, "sha1")) + res, err := Compare(tdh, dh, append(DefaultKeywords, "sha1")) if err != nil { t.Fatal(err) } @@ -164,7 +164,7 @@ func TestArchiveCreation(t *testing.T) { } // Test the tar manifest against itself - res, err = TarCheck(tdh, tdh, []Keyword{"sha1"}) + res, err = Compare(tdh, tdh, []Keyword{"sha1"}) if err != nil { t.Fatal(err) } @@ -180,7 +180,7 @@ func TestArchiveCreation(t *testing.T) { if err != nil { t.Fatal(err) } - res, err = TarCheck(tdh, dh, []Keyword{"sha1"}) + res, err = Compare(tdh, dh, []Keyword{"sha1"}) if err != nil { t.Fatal(err) } @@ -218,7 +218,7 @@ func TestTreeTraversal(t *testing.T) { t.Fatal(err) } - res, err := TarCheck(tdh, tdh, []Keyword{"sha1"}) + res, err := Compare(tdh, tdh, []Keyword{"sha1"}) if err != nil { t.Fatal(err) }