From 94a5728cfb593d80164620f8fa7e1ef322ad0025 Mon Sep 17 00:00:00 2001 From: Daniel Barkalow Date: Thu, 7 Feb 2008 11:40:13 -0500 Subject: Library function to check for unmerged index entries It's small, but it was in three places already, so it should be in the library. Signed-off-by: Daniel Barkalow --- read-cache.c | 10 ++++++++++ 1 file changed, 10 insertions(+) (limited to 'read-cache.c') diff --git a/read-cache.c b/read-cache.c index e45f4b3d61..22d7b46245 100644 --- a/read-cache.c +++ b/read-cache.c @@ -1176,6 +1176,16 @@ int discard_index(struct index_state *istate) return 0; } +int unmerged_index(struct index_state *istate) +{ + int i; + for (i = 0; i < istate->cache_nr; i++) { + if (ce_stage(istate->cache[i])) + return 1; + } + return 0; +} + #define WRITE_BUFFER_SIZE 8192 static unsigned char write_buffer[WRITE_BUFFER_SIZE]; static unsigned long write_buffer_len; -- cgit v1.2.1