Hash :
22b6b82f
Author :
Date :
2013-06-20T12:16:06
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.
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
#ifndef INCLUDE_cl_status_helpers_h__
#define INCLUDE_cl_status_helpers_h__
typedef struct {
int wrong_status_flags_count;
int wrong_sorted_path;
int entry_count;
const unsigned int* expected_statuses;
const char** expected_paths;
int expected_entry_count;
bool debug;
} status_entry_counts;
/* cb_status__normal takes payload of "status_entry_counts *" */
extern int cb_status__normal(
const char *path, unsigned int status_flags, void *payload);
/* cb_status__count takes payload of "int *" */
extern int cb_status__count(const char *p, unsigned int s, void *payload);
typedef struct {
int count;
unsigned int status;
bool debug;
} status_entry_single;
/* cb_status__single takes payload of "status_entry_single *" */
extern int cb_status__single(const char *p, unsigned int s, void *payload);
/* cb_status__print takes optional payload of "int *" */
extern int cb_status__print(const char *p, unsigned int s, void *payload);
#endif