Skip to content
This repository was archived by the owner on Mar 27, 2024. It is now read-only.

Commit 8d81093

Browse files
committed
Don't report difference if modtime of extacted image contents differ
1 parent 423a66a commit 8d81093

File tree

1 file changed

+1
-8
lines changed

1 file changed

+1
-8
lines changed

util/diff_utils.go

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -143,12 +143,8 @@ func DiffFile(image1, image2 *pkgutil.Image, filename string) (*FileNameDiff, er
143143
return nil, err
144144
}
145145

146-
if s1.ModTime() != s2.ModTime() {
147-
description := fmt.Sprintf("%s was modified at %s, %s at %s:", image1.Source, s1.ModTime(), image2.Source, s2.ModTime())
148-
return &FileNameDiff{filename, description, ""}, nil
149-
}
150146
if s1.Mode() != s2.Mode() {
151-
description := fmt.Sprintf("%s had permission bits %s, %s had %s:", image1.Source, s1.Mode(), image2.Source, s2.Mode())
147+
description := fmt.Sprintf("%s in image %s had permission bits %s vs in image %s had %s", filename, image1.Source, s1.Mode(), image2.Source, s2.Mode())
152148
return &FileNameDiff{filename, description, ""}, nil
153149
}
154150

@@ -258,9 +254,6 @@ func GetModifiedEntries(d1, d2 pkgutil.Directory) []string {
258254
continue
259255
}
260256
// Consider the files as different if their metadata differ.
261-
if f1stat.ModTime() != f2stat.ModTime() {
262-
same = false
263-
}
264257
if f1stat.Mode() != f2stat.Mode() {
265258
same = false
266259
}

0 commit comments

Comments
 (0)