diff options
Diffstat (limited to 'src/index.c')
-rw-r--r-- | src/index.c | 57 |
1 files changed, 3 insertions, 54 deletions
diff --git a/src/index.c b/src/index.c index 4deafd77f..6290ec4e8 100644 --- a/src/index.c +++ b/src/index.c @@ -317,7 +317,7 @@ void git_index_free(git_index *index) void git_index_clear(git_index *index) { - unsigned int i; + size_t i; assert(index); @@ -786,7 +786,7 @@ int git_index_remove(git_index *index, const char *path, int stage) if (entry != NULL) git_tree_cache_invalidate_path(index->tree, entry->path); - error = git_vector_remove(&index->entries, (unsigned int)position); + error = git_vector_remove(&index->entries, position); if (!error) index_entry_free(entry); @@ -1129,7 +1129,7 @@ int git_index_reuc_remove(git_index *index, size_t position) git_vector_sort(&index->reuc); reuc = git_vector_get(&index->reuc, position); - error = git_vector_remove(&index->reuc, (unsigned int)position); + error = git_vector_remove(&index->reuc, position); if (!error) index_entry_reuc_free(reuc); @@ -1679,54 +1679,3 @@ git_repository *git_index_owner(const git_index *index) { return INDEX_OWNER(index); } - -int git_index_read_tree_match( - git_index *index, git_tree *tree, git_strarray *strspec) -{ -#if 0 - git_iterator *iter = NULL; - const git_index_entry *entry; - char *pfx = NULL; - git_vector pathspec = GIT_VECTOR_INIT; - git_pool pathpool = GIT_POOL_INIT_STRINGPOOL; -#endif - - if (!git_pathspec_is_interesting(strspec)) - return git_index_read_tree(index, tree); - - return git_index_read_tree(index, tree); - -#if 0 - /* The following loads the matches into the index, but doesn't - * erase obsoleted entries (e.g. you load a blob at "a/b" which - * should obsolete a blob at "a/b/c/d" since b is no longer a tree) - */ - - if (git_pathspec_init(&pathspec, strspec, &pathpool) < 0) - return -1; - - pfx = git_pathspec_prefix(strspec); - - if ((error = git_iterator_for_tree_range(&iter, tree, pfx, pfx)) < 0 || - (error = git_iterator_current(iter, &entry)) < 0) - goto cleanup; - - while (entry != NULL) { - if (git_pathspec_match_path( - &pathspec, entry->path, false, false, NULL) && - (error = git_index_add(index, entry)) < 0) - goto cleanup; - - if ((error = git_iterator_advance(iter, &entry)) < 0) - goto cleanup; - } - -cleanup: - git_iterator_free(iter); - git_pathspec_free(&pathspec); - git_pool_clear(&pathpool); - git__free(pfx); - - return error; -#endif -} |