diff options
| author | Junio C Hamano <gitster@pobox.com> | 2025-11-08 10:33:19 -0800 |
|---|---|---|
| committer | Junio C Hamano <gitster@pobox.com> | 2025-11-08 10:33:19 -0800 |
| commit | 374eaa29420f6c01755fc579e08032fdb9962a7c (patch) | |
| tree | 1c82d8fdfb7bf79615c95be2277388addcbb2bb7 /wt-status.c | |
| parent | Merge branch 'ms/doc-worktree-side-by-side' into seen (diff) | |
| parent | builtin/history: implement "split" subcommand (diff) | |
| download | git-374eaa29420f6c01755fc579e08032fdb9962a7c.tar.gz git-374eaa29420f6c01755fc579e08032fdb9962a7c.zip | |
Merge branch 'ps/history' into seen
"git history" history rewriting UI.
Comments?
* ps/history:
builtin/history: implement "split" subcommand
cache-tree: allow writing in-memory index as tree
add-patch: add support for in-memory index patching
add-patch: remove dependency on "add-interactive" subsystem
add-patch: split out `struct interactive_options`
add-patch: split out header from "add-interactive.h"
builtin/history: implement "reword" subcommand
builtin: add new "history" command
replay: stop using `the_repository`
replay: extract logic to pick commits
wt-status: provide function to expose status for trees
Diffstat (limited to 'wt-status.c')
| -rw-r--r-- | wt-status.c | 24 |
1 files changed, 24 insertions, 0 deletions
diff --git a/wt-status.c b/wt-status.c index e12adb26b9..95942399f8 100644 --- a/wt-status.c +++ b/wt-status.c @@ -612,6 +612,30 @@ static void wt_status_collect_updated_cb(struct diff_queue_struct *q, } } +void wt_status_collect_changes_trees(struct wt_status *s, + const struct object_id *old_treeish, + const struct object_id *new_treeish) +{ + struct diff_options opts = { 0 }; + + repo_diff_setup(s->repo, &opts); + opts.output_format = DIFF_FORMAT_CALLBACK; + opts.format_callback = wt_status_collect_updated_cb; + opts.format_callback_data = s; + opts.detect_rename = s->detect_rename >= 0 ? s->detect_rename : opts.detect_rename; + opts.rename_limit = s->rename_limit >= 0 ? s->rename_limit : opts.rename_limit; + opts.rename_score = s->rename_score >= 0 ? s->rename_score : opts.rename_score; + opts.flags.recursive = 1; + diff_setup_done(&opts); + + diff_tree_oid(old_treeish, new_treeish, "", &opts); + diffcore_std(&opts); + diff_flush(&opts); + wt_status_get_state(s->repo, &s->state, 0); + + diff_free(&opts); +} + static void wt_status_collect_changes_worktree(struct wt_status *s) { struct rev_info rev; |
