diff options
| author | Junio C Hamano <gitster@pobox.com> | 2025-08-15 15:02:44 -0700 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-08-15 15:02:45 -0700 |
| commit | dddb2275d413451f7a01ff3f6c08fe0c6ce8f7b9 (patch) | |
| tree | bbe47c3793ee63e5689a5101abeb9f933efb0f42 /diff-lib.c | |
| parent | Merge branch 'ly/diff-name-only-with-diff-from-content' into next (diff) | |
| parent | diff: teach tree-diff a max-depth parameter (diff) | |
| download | git-dddb2275d413451f7a01ff3f6c08fe0c6ce8f7b9.tar.gz git-dddb2275d413451f7a01ff3f6c08fe0c6ce8f7b9.zip | |
Merge branch 'tc/diff-tree-max-depth' into next
"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
Diffstat (limited to 'diff-lib.c')
| -rw-r--r-- | diff-lib.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/diff-lib.c b/diff-lib.c index 244468dd1a..b8f8f3bc31 100644 --- a/diff-lib.c +++ b/diff-lib.c @@ -115,6 +115,9 @@ void run_diff_files(struct rev_info *revs, unsigned int option) uint64_t start = getnanotime(); struct index_state *istate = revs->diffopt.repo->index; + if (revs->diffopt.max_depth_valid) + die(_("max-depth is not supported for worktree diffs")); + diff_set_mnemonic_prefix(&revs->diffopt, "i/", "w/"); refresh_fsmonitor(istate); @@ -560,6 +563,8 @@ static int diff_cache(struct rev_info *revs, opts.dst_index = NULL; opts.pathspec = &revs->diffopt.pathspec; opts.pathspec->recursive = 1; + if (revs->diffopt.max_depth_valid) + die(_("max-depth is not supported for index diffs")); init_tree_desc(&t, &tree->object.oid, tree->buffer, tree->size); return unpack_trees(1, &t, &opts); |
