mirror of
https://github.com/vbatts/go-mtree.git
synced 2024-11-22 00:15:39 +00:00
Merge pull request #151 from vbatts/clean.00
check: remove unused TarCheck(), for Compare()
This commit is contained in:
commit
53e54ea2f7
2 changed files with 4 additions and 14 deletions
10
check.go
10
check.go
|
@ -18,13 +18,3 @@ func Check(root string, dh *DirectoryHierarchy, keywords []Keyword, fs FsEval) (
|
||||||
|
|
||||||
return Compare(dh, newDh, keywords)
|
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)
|
|
||||||
}
|
|
||||||
|
|
|
@ -109,7 +109,7 @@ func TestTar(t *testing.T) {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
res, err := TarCheck(tdh, dh, append(DefaultKeywords, "sha1"))
|
res, err := Compare(tdh, dh, append(DefaultKeywords, "sha1"))
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
@ -164,7 +164,7 @@ func TestArchiveCreation(t *testing.T) {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Test the tar manifest against itself
|
// Test the tar manifest against itself
|
||||||
res, err = TarCheck(tdh, tdh, []Keyword{"sha1"})
|
res, err = Compare(tdh, tdh, []Keyword{"sha1"})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
@ -180,7 +180,7 @@ func TestArchiveCreation(t *testing.T) {
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
res, err = TarCheck(tdh, dh, []Keyword{"sha1"})
|
res, err = Compare(tdh, dh, []Keyword{"sha1"})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
@ -218,7 +218,7 @@ func TestTreeTraversal(t *testing.T) {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
||||||
res, err := TarCheck(tdh, tdh, []Keyword{"sha1"})
|
res, err := Compare(tdh, tdh, []Keyword{"sha1"})
|
||||||
if err != nil {
|
if err != nil {
|
||||||
t.Fatal(err)
|
t.Fatal(err)
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue