diff options
author | Russell Belfer <rb@github.com> | 2012-09-28 13:40:02 -0700 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2012-10-09 11:54:01 -0700 |
commit | bc16fd3ebf8727900f2b8c2f44cb14fd03f80bcc (patch) | |
tree | a2038177ca25685b108d768e9cabf0ed57d85963 /include | |
parent | fade21db0a7a1d535b6352943ecd7b5ae6841e57 (diff) | |
download | libgit2-bc16fd3ebf8727900f2b8c2f44cb14fd03f80bcc.tar.gz |
Introduce status/diff TYPECHANGE flags
When I wrote the diff code, I based it on core git's diff output
which tends to split a type change into an add and a delete. But
core git's status has the notion of a T (typechange) flag for a
file. This introduces that into our status APIs and modifies the
diff code so it can be forced to not split type changes.
Diffstat (limited to 'include')
-rw-r--r-- | include/git2/diff.h | 4 | ||||
-rw-r--r-- | include/git2/status.h | 23 |
2 files changed, 16 insertions, 11 deletions
diff --git a/include/git2/diff.h b/include/git2/diff.h index 121c40307..24556db73 100644 --- a/include/git2/diff.h +++ b/include/git2/diff.h @@ -49,6 +49,7 @@ enum { GIT_DIFF_DISABLE_PATHSPEC_MATCH = (1 << 11), GIT_DIFF_DELTAS_ARE_ICASE = (1 << 12), GIT_DIFF_INCLUDE_UNTRACKED_CONTENT = (1 << 13), + GIT_DIFF_DONT_SPLIT_TYPECHANGE = (1 << 14), }; /** @@ -116,7 +117,8 @@ typedef enum { GIT_DELTA_RENAMED = 4, GIT_DELTA_COPIED = 5, GIT_DELTA_IGNORED = 6, - GIT_DELTA_UNTRACKED = 7 + GIT_DELTA_UNTRACKED = 7, + GIT_DELTA_TYPECHANGE = 8, } git_delta_t; /** diff --git a/include/git2/status.h b/include/git2/status.h index cc94d7680..725e3ef59 100644 --- a/include/git2/status.h +++ b/include/git2/status.h @@ -19,19 +19,22 @@ */ GIT_BEGIN_DECL -enum { - GIT_STATUS_CURRENT = 0, +typedef enum { + GIT_STATUS_CURRENT = 0, - GIT_STATUS_INDEX_NEW = (1 << 0), - GIT_STATUS_INDEX_MODIFIED = (1 << 1), - GIT_STATUS_INDEX_DELETED = (1 << 2), + GIT_STATUS_INDEX_NEW = (1u << 0), + GIT_STATUS_INDEX_MODIFIED = (1u << 1), + GIT_STATUS_INDEX_DELETED = (1u << 2), + GIT_STATUS_INDEX_RENAMED = (1u << 3), + GIT_STATUS_INDEX_TYPECHANGE = (1u << 4), - GIT_STATUS_WT_NEW = (1 << 3), - GIT_STATUS_WT_MODIFIED = (1 << 4), - GIT_STATUS_WT_DELETED = (1 << 5), + GIT_STATUS_WT_NEW = (1u << 7), + GIT_STATUS_WT_MODIFIED = (1u << 8), + GIT_STATUS_WT_DELETED = (1u << 9), + GIT_STATUS_WT_TYPECHANGE = (1u << 10), - GIT_STATUS_IGNORED = (1 << 6), -}; + GIT_STATUS_IGNORED = (1u << 14), +} git_status_t; /** * Gather file statuses and run a callback for each one. |