mirror of
https://git.proxmox.com/git/libgit2
synced 2026-08-26 18:28:53 +00:00
Merge pull request #3139 from ethomson/diff_conflicts
Include conflicts when diffing
This commit is contained in:
+12
-10
@@ -226,6 +226,7 @@ typedef enum {
|
||||
GIT_DIFF_FLAG_BINARY = (1u << 0), /**< file(s) treated as binary data */
|
||||
GIT_DIFF_FLAG_NOT_BINARY = (1u << 1), /**< file(s) treated as text data */
|
||||
GIT_DIFF_FLAG_VALID_ID = (1u << 2), /**< `id` value is known correct */
|
||||
GIT_DIFF_FLAG_EXISTS = (1u << 3), /**< file exists at this side of the delta */
|
||||
} git_diff_flag_t;
|
||||
|
||||
/**
|
||||
@@ -239,16 +240,17 @@ typedef enum {
|
||||
* DELETED pairs).
|
||||
*/
|
||||
typedef enum {
|
||||
GIT_DELTA_UNMODIFIED = 0, /**< no changes */
|
||||
GIT_DELTA_ADDED = 1, /**< entry does not exist in old version */
|
||||
GIT_DELTA_DELETED = 2, /**< entry does not exist in new version */
|
||||
GIT_DELTA_MODIFIED = 3, /**< entry content changed between old and new */
|
||||
GIT_DELTA_RENAMED = 4, /**< entry was renamed between old and new */
|
||||
GIT_DELTA_COPIED = 5, /**< entry was copied from another old entry */
|
||||
GIT_DELTA_IGNORED = 6, /**< entry is ignored item in workdir */
|
||||
GIT_DELTA_UNTRACKED = 7, /**< entry is untracked item in workdir */
|
||||
GIT_DELTA_TYPECHANGE = 8, /**< type of entry changed between old and new */
|
||||
GIT_DELTA_UNREADABLE = 9, /**< entry is unreadable */
|
||||
GIT_DELTA_UNMODIFIED = 0, /**< no changes */
|
||||
GIT_DELTA_ADDED = 1, /**< entry does not exist in old version */
|
||||
GIT_DELTA_DELETED = 2, /**< entry does not exist in new version */
|
||||
GIT_DELTA_MODIFIED = 3, /**< entry content changed between old and new */
|
||||
GIT_DELTA_RENAMED = 4, /**< entry was renamed between old and new */
|
||||
GIT_DELTA_COPIED = 5, /**< entry was copied from another old entry */
|
||||
GIT_DELTA_IGNORED = 6, /**< entry is ignored item in workdir */
|
||||
GIT_DELTA_UNTRACKED = 7, /**< entry is untracked item in workdir */
|
||||
GIT_DELTA_TYPECHANGE = 8, /**< type of entry changed between old and new */
|
||||
GIT_DELTA_UNREADABLE = 9, /**< entry is unreadable */
|
||||
GIT_DELTA_CONFLICTED = 10, /**< entry in the index is conflicted */
|
||||
} git_delta_t;
|
||||
|
||||
/**
|
||||
|
||||
+11
-1
@@ -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
|
||||
@@ -631,7 +640,8 @@ GIT_EXTERN(int) git_index_find(size_t *at_pos, git_index *index, const char *pat
|
||||
/**@{*/
|
||||
|
||||
/**
|
||||
* Add or update index entries to represent a conflict
|
||||
* Add or update index entries to represent a conflict. Any staged
|
||||
* entries that exist at the given paths will be removed.
|
||||
*
|
||||
* The entries are the entries from the tree included in the merge. Any
|
||||
* entry may be null to indicate that that file was not present in the
|
||||
|
||||
@@ -46,6 +46,7 @@ typedef enum {
|
||||
GIT_STATUS_WT_UNREADABLE = (1u << 12),
|
||||
|
||||
GIT_STATUS_IGNORED = (1u << 14),
|
||||
GIT_STATUS_CONFLICTED = (1u << 15),
|
||||
} git_status_t;
|
||||
|
||||
/**
|
||||
|
||||
Reference in New Issue
Block a user