mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-08 22:08:56 +00:00
status: move GIT_STATUS_PATH_* into an enum
Their actual values have no meaning, so pack them in an enum. Signed-off-by: Carlos Martín Nieto <carlos@cmartin.tk>
This commit is contained in:
parent
68a26dfa7c
commit
1ca715e07a
16
src/status.c
16
src/status.c
@ -166,17 +166,19 @@ exit:
|
|||||||
return error;
|
return error;
|
||||||
}
|
}
|
||||||
|
|
||||||
#define GIT_STATUS_PATH_NULL -2
|
enum path_type {
|
||||||
#define GIT_STATUS_PATH_IGNORE -1
|
GIT_STATUS_PATH_NULL,
|
||||||
#define GIT_STATUS_PATH_FILE 0
|
GIT_STATUS_PATH_IGNORE,
|
||||||
#define GIT_STATUS_PATH_FOLDER 1
|
GIT_STATUS_PATH_FILE,
|
||||||
|
GIT_STATUS_PATH_FOLDER,
|
||||||
|
};
|
||||||
|
|
||||||
static int dirent_cb(void *state, char *full_path);
|
static int dirent_cb(void *state, char *full_path);
|
||||||
static int alphasorted_futils_direach(
|
static int alphasorted_futils_direach(
|
||||||
char *path, size_t path_sz,
|
char *path, size_t path_sz,
|
||||||
int (*fn)(void *, char *), void *arg);
|
int (*fn)(void *, char *), void *arg);
|
||||||
|
|
||||||
static int process_folder(struct status_st *st, const git_tree_entry *tree_entry, char *full_path, int path_type)
|
static int process_folder(struct status_st *st, const git_tree_entry *tree_entry, char *full_path, enum path_type path_type)
|
||||||
{
|
{
|
||||||
git_object *subtree = NULL;
|
git_object *subtree = NULL;
|
||||||
git_tree *pushed_tree = NULL;
|
git_tree *pushed_tree = NULL;
|
||||||
@ -240,7 +242,7 @@ static int determine_status(struct status_st *st,
|
|||||||
const git_index_entry *index_entry,
|
const git_index_entry *index_entry,
|
||||||
char *full_path,
|
char *full_path,
|
||||||
const char *status_path,
|
const char *status_path,
|
||||||
int path_type)
|
enum path_type path_type)
|
||||||
{
|
{
|
||||||
struct status_entry *e;
|
struct status_entry *e;
|
||||||
int error = GIT_SUCCESS;
|
int error = GIT_SUCCESS;
|
||||||
@ -329,7 +331,7 @@ static int dirent_cb(void *state, char *a)
|
|||||||
{
|
{
|
||||||
const git_tree_entry *m;
|
const git_tree_entry *m;
|
||||||
const git_index_entry *entry;
|
const git_index_entry *entry;
|
||||||
int path_type;
|
enum path_type path_type;
|
||||||
int cmpma, cmpmi, cmpai, error;
|
int cmpma, cmpmi, cmpai, error;
|
||||||
const char *pm, *pa, *pi;
|
const char *pm, *pa, *pi;
|
||||||
const char *m_name, *i_name, *a_name;
|
const char *m_name, *i_name, *a_name;
|
||||||
|
Loading…
Reference in New Issue
Block a user