diff options
author | Russell Belfer <rb@github.com> | 2013-06-20 12:16:06 -0700 |
---|---|---|
committer | Russell Belfer <rb@github.com> | 2013-06-20 12:16:06 -0700 |
commit | 22b6b82f2c0d95ce7a433394a6c0574a5714cf4c (patch) | |
tree | 432b4d109e004ed816127b9d22e2b8e706da75b0 /src/vector.h | |
parent | cf300bb9e50c65e4140f7e204243b34f2898fa95 (diff) | |
download | libgit2-22b6b82f2c0d95ce7a433394a6c0574a5714cf4c.tar.gz |
Add status flags to force output sort order
Files in status will, be default, be sorted according to the case
insensitivity of the filesystem that we're running on. However,
in some cases, this is not desirable. Even on case insensitive
file systems, 'git status' at the command line will generally use
a case sensitive sort (like 'ls'). Some GUIs prefer to display a
list of file case insensitively even on case-sensitive platforms.
This adds two new flags: GIT_STATUS_OPT_SORT_CASE_SENSITIVELY
and GIT_STATUS_OPT_SORT_CASE_INSENSITIVELY that will override the
default sort order of the status output and give the user control.
This includes tests for exercising these new options and makes
the examples/status.c program emulate core Git and always use a
case sensitive sort.
Diffstat (limited to 'src/vector.h')
-rw-r--r-- | src/vector.h | 9 |
1 files changed, 9 insertions, 0 deletions
diff --git a/src/vector.h b/src/vector.h index e2f729b83..1bda9c93d 100644 --- a/src/vector.h +++ b/src/vector.h @@ -78,4 +78,13 @@ void git_vector_remove_matching( int git_vector_resize_to(git_vector *v, size_t new_length); int git_vector_set(void **old, git_vector *v, size_t position, void *value); +/** Set the comparison function used for sorting the vector */ +GIT_INLINE(void) git_vector_set_cmp(git_vector *v, git_vector_cmp cmp) +{ + if (cmp != v->_cmp) { + v->_cmp = cmp; + v->sorted = 0; + } +} + #endif |