diff --git a/fs/copy.go b/fs/copy.go index 8c44c7c..f7a8606 100644 --- a/fs/copy.go +++ b/fs/copy.go @@ -17,9 +17,9 @@ var ( } ) -// CopyDirectory copies the directory from src to dst. +// CopyDir copies the directory from src to dst. // Most efficient copy of files is attempted. -func CopyDirectory(dst, src string) error { +func CopyDir(dst, src string) error { inodes := map[uint64]string{} return copyDirectory(dst, src, inodes) } diff --git a/fs/copy_test.go b/fs/copy_test.go index d63be66..0e7cac0 100644 --- a/fs/copy_test.go +++ b/fs/copy_test.go @@ -45,7 +45,7 @@ func testCopy(apply fstest.Applier) error { return errors.Wrap(err, "failed to apply changes") } - if err := CopyDirectory(t2, t1); err != nil { + if err := CopyDir(t2, t1); err != nil { return errors.Wrap(err, "failed to copy") } diff --git a/fs/diff_test.go b/fs/diff_test.go index fb8f012..5eca394 100644 --- a/fs/diff_test.go +++ b/fs/diff_test.go @@ -164,7 +164,7 @@ func testDiffWithBase(base, diff fstest.Applier, expected []testChange) error { return errors.Wrap(err, "failed to apply base filesytem") } - if err := CopyDirectory(t2, t1); err != nil { + if err := CopyDir(t2, t1); err != nil { return errors.Wrap(err, "failed to copy base directory") } diff --git a/snapshot/naive/naive.go b/snapshot/naive/naive.go index bf48583..9099d2b 100644 --- a/snapshot/naive/naive.go +++ b/snapshot/naive/naive.go @@ -66,7 +66,7 @@ func (n *Naive) Prepare(dst, parent string) ([]containerd.Mount, error) { } // Now, we copy the parent filesystem, just a directory, into dst. - if err := fs.CopyDirectory(dst, filepath.Join(parent, "data")); err != nil { + if err := fs.CopyDir(dst, filepath.Join(parent, "data")); err != nil { return nil, errors.Wrap(err, "copying of parent failed") } } @@ -88,7 +88,7 @@ func (n *Naive) Commit(diff, dst string) error { // Move the data into our metadata directory, we could probably save disk // space if we just saved the diff, but let's get something working. - if err := fs.CopyDirectory(filepath.Join(active.metadata, "data"), dst); err != nil { + if err := fs.CopyDir(filepath.Join(active.metadata, "data"), dst); err != nil { return errors.Wrap(err, "copying of parent failed") }