mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-11 04:28:26 +00:00

Adds support for .gitignore files to git_status_foreach() and git_status_file(). This includes refactoring the gitattributes code to share logic where possible. The GIT_STATUS_IGNORED flag will now be passed in for files that are ignored (provided they are not already in the index or the head of repo).
51 lines
1.2 KiB
C
51 lines
1.2 KiB
C
|
|
struct status_entry_counts {
|
|
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;
|
|
};
|
|
|
|
static const char *entry_paths0[] = {
|
|
"file_deleted",
|
|
"ignored_file",
|
|
"modified_file",
|
|
"new_file",
|
|
"staged_changes",
|
|
"staged_changes_file_deleted",
|
|
"staged_changes_modified_file",
|
|
"staged_delete_file_deleted",
|
|
"staged_delete_modified_file",
|
|
"staged_new_file",
|
|
"staged_new_file_deleted_file",
|
|
"staged_new_file_modified_file",
|
|
|
|
"subdir/deleted_file",
|
|
"subdir/modified_file",
|
|
"subdir/new_file",
|
|
};
|
|
|
|
static const unsigned int entry_statuses0[] = {
|
|
GIT_STATUS_WT_DELETED,
|
|
GIT_STATUS_IGNORED,
|
|
GIT_STATUS_WT_MODIFIED,
|
|
GIT_STATUS_WT_NEW,
|
|
GIT_STATUS_INDEX_MODIFIED,
|
|
GIT_STATUS_INDEX_MODIFIED | GIT_STATUS_WT_DELETED,
|
|
GIT_STATUS_INDEX_MODIFIED | GIT_STATUS_WT_MODIFIED,
|
|
GIT_STATUS_INDEX_DELETED,
|
|
GIT_STATUS_INDEX_DELETED | GIT_STATUS_WT_NEW,
|
|
GIT_STATUS_INDEX_NEW,
|
|
GIT_STATUS_INDEX_NEW | GIT_STATUS_WT_DELETED,
|
|
GIT_STATUS_INDEX_NEW | GIT_STATUS_WT_MODIFIED,
|
|
|
|
GIT_STATUS_WT_DELETED,
|
|
GIT_STATUS_WT_MODIFIED,
|
|
GIT_STATUS_WT_NEW,
|
|
};
|
|
|
|
static const size_t entry_count0 = 15;
|
|
|