From e1bcc19110eb7d540dee92af489440dd2953b5d5 Mon Sep 17 00:00:00 2001 From: Russell Belfer Date: Thu, 1 Mar 2012 11:45:00 -0800 Subject: Revert GIT_STATUS constants to avoid issues This reverts the changes to the GIT_STATUS constants and adds a new enumeration to describe the type of change in a git_diff_delta. I don't love this solution, but it should prevent strange errors from occurring for now. Eventually, I would like to unify the various status constants, but it needs a larger plan and I just wanted to eliminate this breakage quickly. --- include/git2/diff.h | 16 +++++++++++++++- include/git2/status.h | 2 +- include/git2/tree.h | 6 ------ 3 files changed, 16 insertions(+), 8 deletions(-) (limited to 'include') diff --git a/include/git2/diff.h b/include/git2/diff.h index 413de8d98..0e7c02fd0 100644 --- a/include/git2/diff.h +++ b/include/git2/diff.h @@ -74,6 +74,20 @@ enum { GIT_DIFF_FILE_UNMAP_DATA = (1 << 5) }; +/** + * What type of change is described by a git_diff_delta? + */ +typedef enum { + GIT_DELTA_UNMODIFIED = 0, + GIT_DELTA_ADDED = 1, + GIT_DELTA_DELETED = 2, + GIT_DELTA_MODIFIED = 3, + GIT_DELTA_RENAMED = 4, + GIT_DELTA_COPIED = 5, + GIT_DELTA_IGNORED = 6, + GIT_DELTA_UNTRACKED = 7 +} git_delta_t; + /** * Description of one side of a diff. */ @@ -101,7 +115,7 @@ typedef struct { typedef struct { git_diff_file old; git_diff_file new; - git_status_t status; /**< value from tree.h */ + git_delta_t status; unsigned int similarity; /**< for RENAMED and COPIED, value from 0 to 100 */ int binary; } git_diff_delta; diff --git a/include/git2/status.h b/include/git2/status.h index 31823c6c5..5c45dae1e 100644 --- a/include/git2/status.h +++ b/include/git2/status.h @@ -31,7 +31,7 @@ GIT_BEGIN_DECL #define GIT_STATUS_WT_MODIFIED (1 << 4) #define GIT_STATUS_WT_DELETED (1 << 5) -#define GIT_STATUS_WT_IGNORED (1 << 6) +#define GIT_STATUS_IGNORED (1 << 6) /** * Gather file statuses and run a callback for each one. diff --git a/include/git2/tree.h b/include/git2/tree.h index 95be1d305..972c3795c 100644 --- a/include/git2/tree.h +++ b/include/git2/tree.h @@ -314,15 +314,9 @@ enum git_treewalk_mode { GIT_EXTERN(int) git_tree_walk(git_tree *tree, git_treewalk_cb callback, int mode, void *payload); typedef enum { - GIT_STATUS_UNMODIFIED = 0, GIT_STATUS_ADDED = 1, GIT_STATUS_DELETED = 2, GIT_STATUS_MODIFIED = 3, - /* the following will only be generated by git_diff functions */ - GIT_STATUS_RENAMED = 4, - GIT_STATUS_COPIED = 5, - GIT_STATUS_IGNORED = 6, - GIT_STATUS_UNTRACKED = 7 } git_status_t; typedef struct { -- cgit v1.2.1