diff options
author | Nguyễn Thái Ngọc Duy <pclouds@gmail.com> | 2018-11-18 17:47:57 +0100 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-11-19 10:50:33 +0900 |
commit | 67022e02145b3be774febf38e9dc228ed11e6f25 (patch) | |
tree | c241ae71cd24dce3dbed93d0e5176c583bb77bf7 /revision.c | |
parent | tree.c: make read_tree*() take 'struct repository *' (diff) | |
download | tgif-67022e02145b3be774febf38e9dc228ed11e6f25.tar.xz |
tree-walk.c: make tree_entry_interesting() take an index
In order to support :(attr) when matching pathspec on a tree,
tree_entry_interesting() needs to take an index (because
git_check_attr() needs it). This is the preparation step for it. This
also makes it clearer what index we fall back to when looking up
attributes during an unpack-trees operation: the source index.
This also fixes revs->pruning.repo initialization that should have
been done in 2abf350385 (revision.c: remove implicit dependency on
the_index - 2018-09-21). Without it, skip_uninteresting() will
dereference a NULL pointer through this call chain
get_revision(revs)
get_revision_internal
get_revision_1
try_to_simplify_commit
rev_compare_tree
diff_tree_oid(..., &revs->pruning)
ll_diff_tree_oid
diff_tree_paths
ll_diff_tree
skip_uninteresting
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'revision.c')
-rw-r--r-- | revision.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/revision.c b/revision.c index 13e0519c02..06708337ef 100644 --- a/revision.c +++ b/revision.c @@ -1463,6 +1463,7 @@ void repo_init_revisions(struct repository *r, revs->abbrev = DEFAULT_ABBREV; revs->ignore_merges = 1; revs->simplify_history = 1; + revs->pruning.repo = r; revs->pruning.flags.recursive = 1; revs->pruning.flags.quick = 1; revs->pruning.add_remove = file_add_remove; |