summaryrefslogtreecommitdiff
path: root/read-cache.c
diff options
context:
space:
mode:
authorJameson Miller <jamill@microsoft.com>2018-07-02 19:49:29 (GMT)
committerJunio C Hamano <gitster@pobox.com>2018-07-03 17:58:15 (GMT)
commit768d7965068189ec5287ac53b4b55bfd443bb456 (patch)
treed7e6fc5e2e8fd15d3207c7155965bcc1f12a1fac /read-cache.c
parent53f9a3e157dbbc901a02ac2c73346d375e24978c (diff)
downloadgit-768d7965068189ec5287ac53b4b55bfd443bb456.zip
git-768d7965068189ec5287ac53b4b55bfd443bb456.tar.gz
git-768d7965068189ec5287ac53b4b55bfd443bb456.tar.bz2
read-cache: teach refresh_cache_entry to take istate
Refactor refresh_cache_entry() to work on a specific index, instead of implicitly using the_index. This is in preparation for making the make_cache_entry function apply to a specific index. Signed-off-by: Jameson Miller <jamill@microsoft.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'read-cache.c')
-rw-r--r--read-cache.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/read-cache.c b/read-cache.c
index 3725882..fa8366e 100644
--- a/read-cache.c
+++ b/read-cache.c
@@ -767,7 +767,7 @@ struct cache_entry *make_cache_entry(unsigned int mode,
ce->ce_namelen = len;
ce->ce_mode = create_ce_mode(mode);
- ret = refresh_cache_entry(ce, refresh_options);
+ ret = refresh_cache_entry(&the_index, ce, refresh_options);
if (ret != ce)
free(ce);
return ret;
@@ -1473,10 +1473,11 @@ int refresh_index(struct index_state *istate, unsigned int flags,
return has_errors;
}
-struct cache_entry *refresh_cache_entry(struct cache_entry *ce,
- unsigned int options)
+struct cache_entry *refresh_cache_entry(struct index_state *istate,
+ struct cache_entry *ce,
+ unsigned int options)
{
- return refresh_cache_ent(&the_index, ce, options, NULL, NULL);
+ return refresh_cache_ent(istate, ce, options, NULL, NULL);
}