[PATCH 03/22] teach diff.c about cache iterators
Signed-off-by: Chuck Lever <cel@netapp.com>
---
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();
}