summaryrefslogtreecommitdiff
path: root/read-cache.c
diff options
context:
space:
mode:
authorDaniel Barkalow <barkalow@iabervon.org>2008-02-07 11:40:13 -0500
committerJunio C Hamano <gitster@pobox.com>2008-02-09 23:16:51 -0800
commit94a5728cfb593d80164620f8fa7e1ef322ad0025 (patch)
tree9bdc3b6efece60e4b72a90b3d5c75670dbf4deb8 /read-cache.c
parent922d87f92f79d76ee1d9027d4a0f8a0cf36d5340 (diff)
downloadgit-94a5728cfb593d80164620f8fa7e1ef322ad0025.tar.gz
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 <barkalow@iabervon.org>
Diffstat (limited to 'read-cache.c')
-rw-r--r--read-cache.c10
1 files changed, 10 insertions, 0 deletions
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;