diff options
Diffstat (limited to 'builtin/mv.c')
-rw-r--r-- | builtin/mv.c | 19 |
1 files changed, 10 insertions, 9 deletions
diff --git a/builtin/mv.c b/builtin/mv.c index 6f94c3b923..883cf3ff12 100644 --- a/builtin/mv.c +++ b/builtin/mv.c @@ -87,7 +87,7 @@ static void prepare_move_submodule(const char *src, int first, const char **submodule_gitfile) { struct strbuf submodule_dotgit = STRBUF_INIT; - if (!S_ISGITLINK(active_cache[first]->ce_mode)) + if (!S_ISGITLINK(the_index.cache[first]->ce_mode)) die(_("Directory %s is in index and no submodule?"), src); if (!is_staging_gitmodules_ok(&the_index)) die(_("Please stage your changes to .gitmodules or stash them to proceed")); @@ -111,8 +111,8 @@ static int index_range_of_same_dir(const char *src, int length, die(_("%.*s is in index"), len_w_slash, src_w_slash); first = -1 - first; - for (last = first; last < active_nr; last++) { - const char *path = active_cache[last]->name; + for (last = first; last < the_index.cache_nr; last++) { + const char *path = the_index.cache[last]->name; if (strncmp(path, src_w_slash, len_w_slash)) break; } @@ -143,7 +143,7 @@ static int empty_dir_has_sparse_contents(const char *name) pos = -pos - 1; if (pos >= the_index.cache_nr) goto free_return; - ce = active_cache[pos]; + ce = the_index.cache[pos]; if (strncmp(with_slash, ce->name, length)) goto free_return; if (ce_skip_worktree(ce)) @@ -268,7 +268,7 @@ int cmd_mv(int argc, const char **argv, const char *prefix) bad = _("bad source"); goto act_on_entry; } - ce = active_cache[pos]; + ce = the_index.cache[pos]; if (!ce_skip_worktree(ce)) { bad = _("bad source"); goto act_on_entry; @@ -331,7 +331,7 @@ dir_check: dst_len = strlen(dst); for (j = 0; j < last - first; j++) { - const struct cache_entry *ce = active_cache[first + j]; + const struct cache_entry *ce = the_index.cache[first + j]; const char *path = ce->name; source[argc + j] = path; destination[argc + j] = @@ -472,7 +472,8 @@ remove_entry: assert(pos >= 0); if (!(mode & SPARSE) && !lstat(src, &st)) sparse_and_dirty = ie_modified(&the_index, - active_cache[pos], &st, + the_index.cache[pos], + &st, 0); rename_index_entry_at(&the_index, pos, dst); @@ -489,7 +490,7 @@ remove_entry: path_in_sparse_checkout(dst, &the_index)) { /* from out-of-cone to in-cone */ int dst_pos = cache_name_pos(dst, strlen(dst)); - struct cache_entry *dst_ce = active_cache[dst_pos]; + struct cache_entry *dst_ce = the_index.cache[dst_pos]; dst_ce->ce_flags &= ~CE_SKIP_WORKTREE; @@ -500,7 +501,7 @@ remove_entry: !path_in_sparse_checkout(dst, &the_index)) { /* from in-cone to out-of-cone */ int dst_pos = cache_name_pos(dst, strlen(dst)); - struct cache_entry *dst_ce = active_cache[dst_pos]; + struct cache_entry *dst_ce = the_index.cache[dst_pos]; /* * if src is clean, it will suffice to remove it |