Merge pull request #155 from tych0/fix-new

compare: return the right delta
This commit is contained in:
Vincent Batts 2020-04-02 14:31:40 -04:00 committed by GitHub
commit d6df813dbc
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -161,10 +161,10 @@ func (k KeyDelta) Old() *string {
// New returns the value of the KeyDeltaVal entry in the "new" DirectoryHierarchy // New returns the value of the KeyDeltaVal entry in the "new" DirectoryHierarchy
// (as determined by the ordering of parameters to Compare). Returns nil if // (as determined by the ordering of parameters to Compare). Returns nil if
// there was no entry in the "old" DirectoryHierarchy. // there was no entry in the "new" DirectoryHierarchy.
func (k KeyDelta) New() *string { func (k KeyDelta) New() *string {
if k.diff == Modified || k.diff == Extra { if k.diff == Modified || k.diff == Extra {
return sPtr(k.old) return sPtr(k.new)
} }
return nil return nil
} }