diff options
| author | Carlos Martín Nieto <carlos@cmartin.tk> | 2011-10-22 12:36:30 +0200 |
|---|---|---|
| committer | Carlos Martín Nieto <carlos@cmartin.tk> | 2011-10-27 16:13:09 -0700 |
| commit | 1ca715e07a3d99b8a79ac606f7ddb81a10709a5e (patch) | |
| tree | 22d652276baa187ebb9eb524d58d6e36c9365a25 /src/status.c | |
| parent | 68a26dfa7c61b6421d7a32176e83b36420b7201b (diff) | |
| download | libgit2-1ca715e07a3d99b8a79ac606f7ddb81a10709a5e.tar.gz | |
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>
Diffstat (limited to 'src/status.c')
| -rw-r--r-- | src/status.c | 16 |
1 files changed, 9 insertions, 7 deletions
diff --git a/src/status.c b/src/status.c index bda4ec59a..c53c4acc9 100644 --- a/src/status.c +++ b/src/status.c @@ -166,17 +166,19 @@ exit: return error; } -#define GIT_STATUS_PATH_NULL -2 -#define GIT_STATUS_PATH_IGNORE -1 -#define GIT_STATUS_PATH_FILE 0 -#define GIT_STATUS_PATH_FOLDER 1 +enum path_type { + GIT_STATUS_PATH_NULL, + GIT_STATUS_PATH_IGNORE, + GIT_STATUS_PATH_FILE, + GIT_STATUS_PATH_FOLDER, +}; static int dirent_cb(void *state, char *full_path); static int alphasorted_futils_direach( char *path, size_t path_sz, 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_tree *pushed_tree = NULL; @@ -240,7 +242,7 @@ static int determine_status(struct status_st *st, const git_index_entry *index_entry, char *full_path, const char *status_path, - int path_type) + enum path_type path_type) { struct status_entry *e; int error = GIT_SUCCESS; @@ -329,7 +331,7 @@ static int dirent_cb(void *state, char *a) { const git_tree_entry *m; const git_index_entry *entry; - int path_type; + enum path_type path_type; int cmpma, cmpmi, cmpai, error; const char *pm, *pa, *pi; const char *m_name, *i_name, *a_name; |
