mirror of
https://git.proxmox.com/git/libgit2
synced 2026-08-26 18:28:53 +00:00
introduce git_index_entry_is_conflict
It's not always obvious the mapping between stage level and conflict-ness. More importantly, this can lead otherwise sane people to write constructs like `if (!git_index_entry_stage(entry))`, which (while technically correct) is unreadable. Provide a nice method to help avoid such messy thinking.
This commit is contained in:
@@ -430,6 +430,15 @@ GIT_EXTERN(int) git_index_add(git_index *index, const git_index_entry *source_en
|
||||
*/
|
||||
GIT_EXTERN(int) git_index_entry_stage(const git_index_entry *entry);
|
||||
|
||||
/**
|
||||
* Return whether the given index entry is a conflict (has a high stage
|
||||
* entry). This is simply shorthand for `git_index_entry_stage > 0`.
|
||||
*
|
||||
* @param entry The entry
|
||||
* @return 1 if the entry is a conflict entry, 0 otherwise
|
||||
*/
|
||||
GIT_EXTERN(int) git_index_entry_is_conflict(const git_index_entry *entry);
|
||||
|
||||
/**@}*/
|
||||
|
||||
/** @name Workdir Index Entry Functions
|
||||
|
||||
Reference in New Issue
Block a user