diff options
author | nulltoken <emeric.fermas@gmail.com> | 2012-11-08 21:08:59 +0100 |
---|---|---|
committer | nulltoken <emeric.fermas@gmail.com> | 2012-11-08 21:16:48 +0100 |
commit | 7cc1bf0fcb6de212dc50e02ff187880af9103bf4 (patch) | |
tree | bf2800a5b62ac15881a0bc8670543bf7231f0ffd /src | |
parent | 29cc374d2e8a73c458805f8e76a286b8b688b80e (diff) | |
download | libgit2-7cc1bf0fcb6de212dc50e02ff187880af9103bf4.tar.gz |
index: Introduce git_index_has_conflicts()
Diffstat (limited to 'src')
-rw-r--r-- | src/index.c | 15 |
1 files changed, 15 insertions, 0 deletions
diff --git a/src/index.c b/src/index.c index 214d29def..0a1cd03f0 100644 --- a/src/index.c +++ b/src/index.c @@ -959,6 +959,21 @@ void git_index_conflict_cleanup(git_index *index) git_vector_remove_matching(&index->entries, index_conflicts_match); } +int git_index_has_conflicts(git_index *index) +{ + unsigned int i; + git_index_entry *entry; + + assert(index); + + git_vector_foreach(&index->entries, i, entry) { + if (index_entry_stage(entry) > 0) + return 1; + } + + return 0; +} + unsigned int git_index_reuc_entrycount(git_index *index) { assert(index); |