mirror of
https://git.proxmox.com/git/libgit2
synced 2025-08-17 01:50:57 +00:00
index: Add git_index_entry_stage
method
As suggested by Romain-Geissler
This commit is contained in:
parent
0291b5b76b
commit
3a42e0a370
@ -287,6 +287,18 @@ GIT_EXTERN(unsigned int) git_index_entrycount_unmerged(git_index *index);
|
|||||||
*/
|
*/
|
||||||
GIT_EXTERN(const git_index_entry_unmerged *) git_index_get_unmerged(git_index *index, const char *path);
|
GIT_EXTERN(const git_index_entry_unmerged *) git_index_get_unmerged(git_index *index, const char *path);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Return the stage number from a git index entry
|
||||||
|
*
|
||||||
|
* This entry is calculated from the entrie's flag
|
||||||
|
* attribute like this:
|
||||||
|
*
|
||||||
|
* (entry->flags & GIT_IDXENTRY_STAGEMASK) >> GIT_IDXENTRY_STAGESHIFT
|
||||||
|
*
|
||||||
|
* @param entry The entry
|
||||||
|
* @returns the stage number
|
||||||
|
*/
|
||||||
|
GIT_EXTERN(int) git_index_entry_stage(const git_index_entry *entry);
|
||||||
|
|
||||||
/** @} */
|
/** @} */
|
||||||
GIT_END_DECL
|
GIT_END_DECL
|
||||||
|
@ -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");
|
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;
|
||||||
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user