diff options
author | Junio C Hamano <gitster@pobox.com> | 2018-04-11 03:46:32 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2018-04-11 03:46:32 +0200 |
commit | 2d5792f0716605ff0059fe4b5c865d6821c0161e (patch) | |
tree | f54d21723cf1216001ec9643f91f0d60136a8643 /split-index.c | |
parent | commit-graph: implement "--append" option (diff) | |
parent | replace: rename 'new' variables (diff) | |
download | git-2d5792f0716605ff0059fe4b5c865d6821c0161e.tar.xz git-2d5792f0716605ff0059fe4b5c865d6821c0161e.zip |
Merge branch 'bw/c-plus-plus' into ds/lazy-load-trees
* bw/c-plus-plus: (37 commits)
replace: rename 'new' variables
trailer: rename 'template' variables
tempfile: rename 'template' variables
wrapper: rename 'template' variables
environment: rename 'namespace' variables
diff: rename 'template' variables
environment: rename 'template' variables
init-db: rename 'template' variables
unpack-trees: rename 'new' variables
trailer: rename 'new' variables
submodule: rename 'new' variables
split-index: rename 'new' variables
remote: rename 'new' variables
ref-filter: rename 'new' variables
read-cache: rename 'new' variables
line-log: rename 'new' variables
imap-send: rename 'new' variables
http: rename 'new' variables
entry: rename 'new' variables
diffcore-delta: rename 'new' variables
...
Diffstat (limited to 'split-index.c')
-rw-r--r-- | split-index.c | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/split-index.c b/split-index.c index 284d04d67f..3eb8ff1b43 100644 --- a/split-index.c +++ b/split-index.c @@ -305,17 +305,17 @@ void save_or_free_index_entry(struct index_state *istate, struct cache_entry *ce } void replace_index_entry_in_base(struct index_state *istate, - struct cache_entry *old, - struct cache_entry *new) + struct cache_entry *old_entry, + struct cache_entry *new_entry) { - if (old->index && + if (old_entry->index && istate->split_index && istate->split_index->base && - old->index <= istate->split_index->base->cache_nr) { - new->index = old->index; - if (old != istate->split_index->base->cache[new->index - 1]) - free(istate->split_index->base->cache[new->index - 1]); - istate->split_index->base->cache[new->index - 1] = new; + old_entry->index <= istate->split_index->base->cache_nr) { + new_entry->index = old_entry->index; + if (old_entry != istate->split_index->base->cache[new_entry->index - 1]) + free(istate->split_index->base->cache[new_entry->index - 1]); + istate->split_index->base->cache[new_entry->index - 1] = new_entry; } } |