Checks for changes in e1's and e2's metadata when they have the same content, and updates the stats accordingly. The function is not concurrency safe, as it updates st without any locking.
(ctx context.Context, e1, e2 fs.Entry, path string, st *EntryTypeStats)
| 209 | // and updates the stats accordingly. |
| 210 | // The function is not concurrency safe, as it updates st without any locking. |
| 211 | func compareMetadata(ctx context.Context, e1, e2 fs.Entry, path string, st *EntryTypeStats) { |
| 212 | var changed bool |
| 213 | |
| 214 | if m1, m2 := e1.Mode(), e2.Mode(); m1 != m2 { |
| 215 | changed = true |
| 216 | st.SameContentButDifferentMode++ |
| 217 | } |
| 218 | |
| 219 | if mt1, mt2 := e1.ModTime(), e2.ModTime(); !mt1.Equal(mt2) { |
| 220 | changed = true |
| 221 | st.SameContentButDifferentModificationTime++ |
| 222 | } |
| 223 | |
| 224 | o1, o2 := e1.Owner(), e2.Owner() |
| 225 | if o1.UserID != o2.UserID { |
| 226 | changed = true |
| 227 | st.SameContentButDifferentUserOwner++ |
| 228 | } |
| 229 | |
| 230 | if o1.GroupID != o2.GroupID { |
| 231 | changed = true |
| 232 | st.SameContentButDifferentGroupOwner++ |
| 233 | } |
| 234 | |
| 235 | if changed { |
| 236 | st.SameContentButDifferentMetadata++ |
| 237 | |
| 238 | log(ctx).Debugf("content unchanged but metadata has been modified: %v", path) |
| 239 | } |
| 240 | } |
| 241 | |
| 242 | func (c *Comparer) compareEntryMetadata(e1, e2 fs.Entry, fullpath string) { |
| 243 | switch { |
no test coverage detected