diff options
author | Vicent Marti <tanoku@gmail.com> | 2011-06-03 21:38:55 +0200 |
---|---|---|
committer | Vicent Marti <tanoku@gmail.com> | 2011-06-03 21:38:55 +0200 |
commit | 3a42e0a3705d5d47ed32579721a62edf4ff297b1 (patch) | |
tree | 3597fede71b01373d48e3c67464c5a217e0fe3e0 /src | |
parent | 0291b5b76bd8dcbac1118533c7a79a619ade766c (diff) | |
download | libgit2-3a42e0a3705d5d47ed32579721a62edf4ff297b1.tar.gz |
index: Add `git_index_entry_stage` method
As suggested by Romain-Geissler
Diffstat (limited to 'src')
-rw-r--r-- | src/index.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/index.c b/src/index.c index 8517b8060..c86d37a08 100644 --- a/src/index.c +++ b/src/index.c @@ -980,3 +980,8 @@ static int write_index(git_index *index, git_filebuf *file) return error == GIT_SUCCESS ? GIT_SUCCESS : git__rethrow(error, "Failed to write index"); } + +int git_index_entry_stage(const git_index_entry *entry) +{ + return (entry->flags & GIT_IDXENTRY_STAGEMASK) >> GIT_IDXENTRY_STAGESHIFT; +} |