From: Chuck Lever Date: Mon, 12 Sep 2005 14:55:50 GMT Subject: [PATCH 03/22] teach diff.c about cache iterators Message-ID: <20050912145549.28120.8321.stgit@dexter.citi.umich.edu> In-Reply-To: <20050912145543.28120.7086.stgit@dexter.citi.umich.edu> Signed-off-by: Chuck Lever --- diff.c | 6 +++--- 1 files changed, 3 insertions(+), 3 deletions(-) diff --git a/diff.c b/diff.c --- a/diff.c +++ b/diff.c @@ -258,7 +258,7 @@ static int work_tree_matches(const char * by diff-cache --cached, which does read the cache before * calling us. */ - if (!active_cache) + if (read_cache_needed()) return 0; len = strlen(name); @@ -677,12 +677,12 @@ void diff_setup(int flags) if (flags & DIFF_SETUP_REVERSE) reverse_diff = 1; if (flags & DIFF_SETUP_USE_CACHE) { - if (!active_cache) + if (read_cache_needed()) /* read-cache does not die even when it fails * so it is safe for us to do this here. Also * it does not smudge active_cache or active_nr * when it fails, so we do not have to worry about - * cleaning it up oufselves either. + * cleaning it up ourselves either. */ read_cache(); }