Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Proposal: use heuristic for determining comparison result #305

Closed
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 9 additions & 1 deletion dive/filetree/file_node.go
Original file line number Diff line number Diff line change
Expand Up @@ -321,5 +321,13 @@ func (node *FileNode) compare(other *FileNode) DiffType {
panic("comparing mismatched nodes")
}

return node.Data.FileInfo.Compare(other.Data.FileInfo)
if node.Parent == other.Parent {
return Unmodified
}

// If any of the other previous checks don't pass, then the other node is
// present in both layers. It doesn't really matter //why//; whatever
// built the image already made the decision that the file was modified
// and decided to include it in the layer.
return Modified
}