Andrew's git
/
gitweb.git
/ diff
summary
|
log
|
commit
| diff |
tree
commit
grep
author
committer
pickaxe
?
re
diff-lib.c: remove implicit dependency on the_index
author
Nguyễn Thái Ngọc Duy
<pclouds@gmail.com>
Fri, 21 Sep 2018 15:57:26 +0000
(17:57 +0200)
committer
Junio C Hamano
<gitster@pobox.com>
Fri, 21 Sep 2018 16:48:10 +0000
(09:48 -0700)
Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
diff-lib.c
patch
|
blob
|
history
raw
|
patch
|
inline
| side by side (parent:
d7b665c
)
diff --git
a/diff-lib.c
b/diff-lib.c
index 88a98b1c06e8792136eced81a7da5f9aacb8542f..c54773fe123fe3118cbd3036cebbd30097aaca10 100644
(file)
--- a/
diff-lib.c
+++ b/
diff-lib.c
@@
-70,7
+70,7
@@
static int match_stat_with_submodule(struct diff_options *diffopt,
struct stat *st, unsigned ce_option,
unsigned *dirty_submodule)
{
struct stat *st, unsigned ce_option,
unsigned *dirty_submodule)
{
- int changed =
ce_match_stat(
ce, st, ce_option);
+ int changed =
ie_match_stat(diffopt->repo->index,
ce, st, ce_option);
if (S_ISGITLINK(ce->ce_mode)) {
struct diff_flags orig_flags = diffopt->flags;
if (!diffopt->flags.override_submodule_config)
if (S_ISGITLINK(ce->ce_mode)) {
struct diff_flags orig_flags = diffopt->flags;
if (!diffopt->flags.override_submodule_config)
@@
-93,15
+93,16
@@
int run_diff_files(struct rev_info *revs, unsigned int option)
unsigned ce_option = ((option & DIFF_RACY_IS_MODIFIED)
? CE_MATCH_RACY_IS_DIRTY : 0);
uint64_t start = getnanotime();
unsigned ce_option = ((option & DIFF_RACY_IS_MODIFIED)
? CE_MATCH_RACY_IS_DIRTY : 0);
uint64_t start = getnanotime();
+ struct index_state *istate = revs->diffopt.repo->index;
diff_set_mnemonic_prefix(&revs->diffopt, "i/", "w/");
if (diff_unmerged_stage < 0)
diff_unmerged_stage = 2;
diff_set_mnemonic_prefix(&revs->diffopt, "i/", "w/");
if (diff_unmerged_stage < 0)
diff_unmerged_stage = 2;
- entries =
activ
e_nr;
+ entries =
istate->cach
e_nr;
for (i = 0; i < entries; i++) {
unsigned int oldmode, newmode;
for (i = 0; i < entries; i++) {
unsigned int oldmode, newmode;
- struct cache_entry *ce =
active_
cache[i];
+ struct cache_entry *ce =
istate->
cache[i];
int changed;
unsigned dirty_submodule = 0;
const struct object_id *old_oid, *new_oid;
int changed;
unsigned dirty_submodule = 0;
const struct object_id *old_oid, *new_oid;
@@
-109,7
+110,7
@@
int run_diff_files(struct rev_info *revs, unsigned int option)
if (diff_can_quit_early(&revs->diffopt))
break;
if (diff_can_quit_early(&revs->diffopt))
break;
- if (!ce_path_match(
&the_index
, ce, &revs->prune_data, NULL))
+ if (!ce_path_match(
istate
, ce, &revs->prune_data, NULL))
continue;
if (ce_stage(ce)) {
continue;
if (ce_stage(ce)) {
@@
-145,7
+146,7
@@
int run_diff_files(struct rev_info *revs, unsigned int option)
dpath->mode = wt_mode;
while (i < entries) {
dpath->mode = wt_mode;
while (i < entries) {
- struct cache_entry *nce =
active_
cache[i];
+ struct cache_entry *nce =
istate->
cache[i];
int stage;
if (strcmp(ce->name, nce->name))
int stage;
if (strcmp(ce->name, nce->name))
@@
-474,7
+475,9
@@
static int oneway_diff(const struct cache_entry * const *src,
if (tree == o->df_conflict_entry)
tree = NULL;
if (tree == o->df_conflict_entry)
tree = NULL;
- if (ce_path_match(&the_index, idx ? idx : tree, &revs->prune_data, NULL)) {
+ if (ce_path_match(revs->diffopt.repo->index,
+ idx ? idx : tree,
+ &revs->prune_data, NULL)) {
do_oneway_diff(o, idx, tree);
if (diff_can_quit_early(&revs->diffopt)) {
o->exiting_early = 1;
do_oneway_diff(o, idx, tree);
if (diff_can_quit_early(&revs->diffopt)) {
o->exiting_early = 1;
@@
-506,7
+509,7
@@
static int diff_cache(struct rev_info *revs,
opts.merge = 1;
opts.fn = oneway_diff;
opts.unpack_data = revs;
opts.merge = 1;
opts.fn = oneway_diff;
opts.unpack_data = revs;
- opts.src_index =
&the_
index;
+ opts.src_index =
revs->diffopt.repo->
index;
opts.dst_index = NULL;
opts.pathspec = &revs->diffopt.pathspec;
opts.pathspec->recursive = 1;
opts.dst_index = NULL;
opts.pathspec = &revs->diffopt.pathspec;
opts.pathspec->recursive = 1;