read-cache.c: extend make_cache_entry refresh flag with options

Convert the make_cache_entry boolean 'refresh' argument to a more
general 'refresh_options' argument.  Pass the value through to the
underlying refresh_cache_ent call.  Add option CE_MATCH_REFRESH to
enable stat refresh.  Update call sites to use the new signature.

Signed-off-by: Brad King <brad.king@kitware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Brad King
2014-01-27 09:45:08 -05:00
committed by Junio C Hamano
parent 2e2e7ec1ef
commit 257627268a
3 changed files with 16 additions and 12 deletions

View File

@ -201,7 +201,8 @@ static int add_cacheinfo(unsigned int mode, const unsigned char *sha1,
const char *path, int stage, int refresh, int options)
{
struct cache_entry *ce;
ce = make_cache_entry(mode, sha1 ? sha1 : null_sha1, path, stage, refresh);
ce = make_cache_entry(mode, sha1 ? sha1 : null_sha1, path, stage,
(refresh ? CE_MATCH_REFRESH : 0 ));
if (!ce)
return error(_("addinfo_cache failed for path '%s'"), path);
return add_cache_entry(ce, options);