Entry argument passed to git_index_add_frombuffer() should be const
diff --git a/include/git2/index.h b/include/git2/index.h
index 1feeb6f..92636ad 100644
--- a/include/git2/index.h
+++ b/include/git2/index.h
@@ -485,7 +485,7 @@ GIT_EXTERN(int) git_index_add_bypath(git_index *index, const char *path);
*/
GIT_EXTERN(int) git_index_add_frombuffer(
git_index *index,
- git_index_entry *entry,
+ const git_index_entry *entry,
const void *buffer, size_t len);
/**
diff --git a/src/index.c b/src/index.c
index 9880e8f..dbcc37a 100644
--- a/src/index.c
+++ b/src/index.c
@@ -1091,7 +1091,7 @@ static bool valid_filemode(const int filemode)
}
int git_index_add_frombuffer(
- git_index *index, git_index_entry *source_entry,
+ git_index *index, const git_index_entry *source_entry,
const void *buffer, size_t len)
{
git_index_entry *entry = NULL;