diff --git a/changes.go b/changes.go index e50b88758a..dc1b015726 100644 --- a/changes.go +++ b/changes.go @@ -65,7 +65,7 @@ func Changes(layers []string, rw string) ([]Change, error) { file := filepath.Base(path) // If there is a whiteout, then the file was removed if strings.HasPrefix(file, ".wh.") { - originalFile := strings.TrimPrefix(file, ".wh.") + originalFile := file[len(".wh."):] change.Path = filepath.Join(filepath.Dir(path), originalFile) change.Kind = ChangeDelete } else {