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 /examples/status.c | |
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 'examples/status.c')
-rw-r--r-- | examples/status.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/examples/status.c b/examples/status.c index 2378c78b6..3c82640b2 100644 --- a/examples/status.c +++ b/examples/status.c @@ -203,7 +203,8 @@ int main(int argc, char *argv[]) opt.show = GIT_STATUS_SHOW_INDEX_AND_WORKDIR; opt.flags = GIT_STATUS_OPT_INCLUDE_UNTRACKED | - GIT_STATUS_OPT_RENAMES_HEAD_TO_INDEX; + GIT_STATUS_OPT_RENAMES_HEAD_TO_INDEX | + GIT_STATUS_OPT_SORT_CASE_SENSITIVELY; for (i = 1; i < argc; ++i) { if (argv[i][0] != '-') { |