···11+package tree
22+33+// HasSameType reports whether mode and other describe the same tree entry kind.
44+//
55+// Regular files and executable files have the same type for diff-status purposes.
66+func (mode FileMode) HasSameType(other FileMode) bool {
77+ if mode == other {
88+ return true
99+ }
1010+1111+ return mode.details().isRegularFile && other.details().isRegularFile
1212+}