package object

import (
	
	

	
	
)
DiffTree compares the content and mode of the blobs found via two tree objects. DiffTree does not perform rename detection, use DiffTreeWithOptions instead to detect renames.
func (,  *Tree) (Changes, error) {
	return DiffTreeContext(context.Background(), , )
}
DiffTreeContext compares the content and mode of the blobs found via two tree objects. Provided context must be non-nil. An error will be returned if context expires.
func ( context.Context, ,  *Tree) (Changes, error) {
	return DiffTreeWithOptions(, , , nil)
}
DiffTreeOptions are the configurable options when performing a diff tree.
DetectRenames is whether the diff tree will use rename detection.
RenameScore is the threshold to of similarity between files to consider that a pair of delete and insert are a rename. The number must be exactly between 0 and 100.
RenameLimit is the maximum amount of files that can be compared when detecting renames. The number of comparisons that have to be performed is equal to the number of deleted files * the number of added files. That means, that if 100 files were deleted and 50 files were added, 5000 file comparisons may be needed. So, if the rename limit is 50, the number of both deleted and added needs to be equal or less than 50. A value of 0 means no limit.
OnlyExactRenames performs only detection of exact renames and will not perform any detection of renames based on file similarity.
DefaultDiffTreeOptions are the default and recommended options for the diff tree.
DiffTreeWithOptions compares the content and mode of the blobs found via two tree objects with the given options. The provided context must be non-nil. If no options are passed, no rename detection will be performed. The recommended options are DefaultDiffTreeOptions. An error will be returned if the context expires. This function will be deprecated and removed in v6 so the default behaviour of DiffTree is to detect renames.
func (
	 context.Context,
	,  *Tree,
	 *DiffTreeOptions,
) (Changes, error) {
	 := NewTreeRootNode()
	 := NewTreeRootNode()

	 := func(,  noder.Hasher) bool {
		return bytes.Equal(.Hash(), .Hash())
	}

	,  := merkletrie.DiffTreeContext(, , , )
	if  != nil {
		if  == merkletrie.ErrCanceled {
			return nil, ErrCanceled
		}
		return nil, 
	}

	,  := newChanges()
	if  != nil {
		return nil, 
	}

	if  == nil {
		 = new(DiffTreeOptions)
	}

	if .DetectRenames {
		return DetectRenames(, )
	}

	return , nil