Merge branch 'tc/diff-tree-max-depth'

"git diff-tree" learned "--max-depth" option.

* tc/diff-tree-max-depth:
  diff: teach tree-diff a max-depth parameter
  within_depth: fix return for empty path
  combine-diff: zero memory used for callback filepairs
This commit is contained in:
Junio C Hamano
2025-08-25 14:22:00 -07:00
11 changed files with 308 additions and 5 deletions

8
diff.h
View File

@@ -406,6 +406,14 @@ struct diff_options {
struct strmap *additional_path_headers;
int no_free;
/*
* The value '0' is a valid max-depth (for no recursion), and value '-1'
* also (for unlimited recursion), so the extra "valid" flag is used to
* determined whether the user specified option --max-depth.
*/
int max_depth;
int max_depth_valid;
};
unsigned diff_filter_bit(char status);