mirror of
https://git.proxmox.com/git/libgit2
synced 2025-08-04 17:13:25 +00:00
status: remove git_index_entry_bypos
This function is already implemented (better) as git_index_get. Change the only caller to use that function. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
This commit is contained in:
parent
d533c8885b
commit
899cb7a876
13
src/status.c
13
src/status.c
@ -337,17 +337,6 @@ static const git_tree_entry *git_tree_entry_bypos(git_tree *tree, unsigned int i
|
||||
return git_vector_get(&tree->entries, idx);
|
||||
}
|
||||
|
||||
/*
|
||||
* Convenience method to enumerate the index. This method is not supposed to be exposed
|
||||
* as part of the index API because it precludes that the index will not be altered
|
||||
* while the enumeration is being processed. Which wouldn't be very API friendly :)
|
||||
*/
|
||||
static const git_index_entry *git_index_entry_bypos(git_index *index, unsigned int idx)
|
||||
{
|
||||
assert(index);
|
||||
return git_vector_get(&index->entries, idx);
|
||||
}
|
||||
|
||||
/* Greatly inspired from JGit IndexTreeWalker */
|
||||
/* https://github.com/spearce/jgit/blob/ed47e29c777accfa78c6f50685a5df2b8f5b8ff5/org.spearce.jgit/src/org/spearce/jgit/lib/IndexTreeWalker.java#L88 */
|
||||
|
||||
@ -371,7 +360,7 @@ static int dirent_cb(void *state, char *a)
|
||||
|
||||
while (1) {
|
||||
m = git_tree_entry_bypos(st->tree, st->tree_position);
|
||||
entry = git_index_entry_bypos(st->index, st->index_position);
|
||||
entry = git_index_get(st->index, st->index_position);
|
||||
|
||||
if ((m == NULL) && (a == NULL) && (entry == NULL))
|
||||
return GIT_SUCCESS;
|
||||
|
Loading…
Reference in New Issue
Block a user