--- v3
+++ v2
@@ -1,6 +1,4 @@
From: Derrick Stolee <dstolee@microsoft.com>
-
-Also use "repo->index" over "istate" when possible.
Signed-off-by: Derrick Stolee <dstolee@microsoft.com>
---
@@ -8,10 +6,10 @@
1 file changed, 7 insertions(+), 7 deletions(-)
diff --git a/builtin/update-index.c b/builtin/update-index.c
-index 0c5a10f5dba..2b03b29261b 100644
+index 3e459d2b9de..106bfdab78e 100644
--- a/builtin/update-index.c
+++ b/builtin/update-index.c
-@@ -345,7 +345,7 @@ static int process_directory(const char *path, int len, struct stat *st)
+@@ -346,7 +346,7 @@ static int process_directory(const char *path, int len, struct stat *st)
/* Inexact match: is there perhaps a subdirectory match? */
pos = -pos-1;
@@ -25,8 +23,8 @@
/* already merged */
pos = unmerge_cache_entry_at(pos);
- if (pos < active_nr) {
-+ if (pos < repo->index->cache_nr) {
- const struct cache_entry *ce = repo->index->cache[pos];
++ if (pos < istate->cache_nr) {
+ const struct cache_entry *ce = istate->cache[pos];
if (ce_stage(ce) &&
ce_namelen(ce) == namelen &&
@@ -641,7 +641,7 @@ static int unresolve_one(const char *path)
@@ -34,8 +32,8 @@
*/
pos = -pos-1;
- if (pos < active_nr) {
-+ if (pos < repo->index->cache_nr) {
- const struct cache_entry *ce = repo->index->cache[pos];
++ if (pos < istate->cache_nr) {
+ const struct cache_entry *ce = istate->cache[pos];
if (ce_namelen(ce) == namelen &&
!memcmp(ce->name, path, namelen)) {
@@ -737,7 +737,7 @@ static int do_reupdate(int ac, const char **av,
@@ -43,8 +41,8 @@
has_head = 0;
redo:
- for (pos = 0; pos < active_nr; pos++) {
-+ for (pos = 0; pos < repo->index->cache_nr; pos++) {
- const struct cache_entry *ce = repo->index->cache[pos];
++ for (pos = 0; pos < istate->cache_nr; pos++) {
+ const struct cache_entry *ce = istate->cache[pos];
struct cache_entry *old = NULL;
int save_nr;
@@ -755,14 +755,14 @@ static int do_reupdate(int ac, const char **av,
@@ -52,16 +50,16 @@
/* Be careful. The working tree may not have the
* path anymore, in which case, under 'allow_remove',
- * or worse yet 'allow_replace', active_nr may decrease.
-+ * or worse yet 'allow_replace', repo->index->cache_nr may decrease.
++ * or worse yet 'allow_replace', istate->cache_nr may decrease.
*/
- save_nr = active_nr;
-+ save_nr = repo->index->cache_nr;
++ save_nr = istate->cache_nr;
path = xstrdup(ce->name);
update_one(path);
free(path);
discard_cache_entry(old);
- if (save_nr != active_nr)
-+ if (save_nr != repo->index->cache_nr)
++ if (save_nr != istate->cache_nr)
goto redo;
}
clear_pathspec(&pathspec);