Commit df3063ea by Edward Thomson

rebase: update enum type name for consistency

libgit2 does not use `type_t` suffixes as it's redundant; thus, rename
`git_rebase_type_t` to `git_rebase_t` for consistency.
parent 94beb3a3
...@@ -49,18 +49,18 @@ ...@@ -49,18 +49,18 @@
#define REBASE_FILE_MODE 0666 #define REBASE_FILE_MODE 0666
typedef enum { typedef enum {
GIT_REBASE_TYPE_NONE = 0, GIT_REBASE_NONE = 0,
GIT_REBASE_TYPE_APPLY = 1, GIT_REBASE_APPLY = 1,
GIT_REBASE_TYPE_MERGE = 2, GIT_REBASE_MERGE = 2,
GIT_REBASE_TYPE_INTERACTIVE = 3, GIT_REBASE_INTERACTIVE = 3,
} git_rebase_type_t; } git_rebase_t;
struct git_rebase { struct git_rebase {
git_repository *repo; git_repository *repo;
git_rebase_options options; git_rebase_options options;
git_rebase_type_t type; git_rebase_t type;
char *state_path; char *state_path;
int head_detached : 1, int head_detached : 1,
...@@ -86,18 +86,18 @@ struct git_rebase { ...@@ -86,18 +86,18 @@ struct git_rebase {
#define GIT_REBASE_STATE_INIT {0} #define GIT_REBASE_STATE_INIT {0}
static int rebase_state_type( static int rebase_state_type(
git_rebase_type_t *type_out, git_rebase_t *type_out,
char **path_out, char **path_out,
git_repository *repo) git_repository *repo)
{ {
git_buf path = GIT_BUF_INIT; git_buf path = GIT_BUF_INIT;
git_rebase_type_t type = GIT_REBASE_TYPE_NONE; git_rebase_t type = GIT_REBASE_NONE;
if (git_buf_joinpath(&path, repo->gitdir, REBASE_APPLY_DIR) < 0) if (git_buf_joinpath(&path, repo->gitdir, REBASE_APPLY_DIR) < 0)
return -1; return -1;
if (git_path_isdir(git_buf_cstr(&path))) { if (git_path_isdir(git_buf_cstr(&path))) {
type = GIT_REBASE_TYPE_APPLY; type = GIT_REBASE_APPLY;
goto done; goto done;
} }
...@@ -106,14 +106,14 @@ static int rebase_state_type( ...@@ -106,14 +106,14 @@ static int rebase_state_type(
return -1; return -1;
if (git_path_isdir(git_buf_cstr(&path))) { if (git_path_isdir(git_buf_cstr(&path))) {
type = GIT_REBASE_TYPE_MERGE; type = GIT_REBASE_MERGE;
goto done; goto done;
} }
done: done:
*type_out = type; *type_out = type;
if (type != GIT_REBASE_TYPE_NONE && path_out) if (type != GIT_REBASE_NONE && path_out)
*path_out = git_buf_detach(&path); *path_out = git_buf_detach(&path);
git_buf_dispose(&path); git_buf_dispose(&path);
...@@ -314,7 +314,7 @@ int git_rebase_open( ...@@ -314,7 +314,7 @@ int git_rebase_open(
if ((error = rebase_state_type(&rebase->type, &rebase->state_path, repo)) < 0) if ((error = rebase_state_type(&rebase->type, &rebase->state_path, repo)) < 0)
goto done; goto done;
if (rebase->type == GIT_REBASE_TYPE_NONE) { if (rebase->type == GIT_REBASE_NONE) {
git_error_set(GIT_ERROR_REBASE, "there is no rebase in progress"); git_error_set(GIT_ERROR_REBASE, "there is no rebase in progress");
error = GIT_ENOTFOUND; error = GIT_ENOTFOUND;
goto done; goto done;
...@@ -370,14 +370,14 @@ int git_rebase_open( ...@@ -370,14 +370,14 @@ int git_rebase_open(
rebase->orig_head_name = git_buf_detach(&orig_head_name); rebase->orig_head_name = git_buf_detach(&orig_head_name);
switch (rebase->type) { switch (rebase->type) {
case GIT_REBASE_TYPE_INTERACTIVE: case GIT_REBASE_INTERACTIVE:
git_error_set(GIT_ERROR_REBASE, "interactive rebase is not supported"); git_error_set(GIT_ERROR_REBASE, "interactive rebase is not supported");
error = -1; error = -1;
break; break;
case GIT_REBASE_TYPE_MERGE: case GIT_REBASE_MERGE:
error = rebase_open_merge(rebase); error = rebase_open_merge(rebase);
break; break;
case GIT_REBASE_TYPE_APPLY: case GIT_REBASE_APPLY:
git_error_set(GIT_ERROR_REBASE, "patch application rebase is not supported"); git_error_set(GIT_ERROR_REBASE, "patch application rebase is not supported");
error = -1; error = -1;
break; break;
...@@ -509,12 +509,12 @@ int git_rebase_init_options(git_rebase_options *opts, unsigned int version) ...@@ -509,12 +509,12 @@ int git_rebase_init_options(git_rebase_options *opts, unsigned int version)
static int rebase_ensure_not_in_progress(git_repository *repo) static int rebase_ensure_not_in_progress(git_repository *repo)
{ {
int error; int error;
git_rebase_type_t type; git_rebase_t type;
if ((error = rebase_state_type(&type, NULL, repo)) < 0) if ((error = rebase_state_type(&type, NULL, repo)) < 0)
return error; return error;
if (type != GIT_REBASE_TYPE_NONE) { if (type != GIT_REBASE_NONE) {
git_error_set(GIT_ERROR_REBASE, "there is an existing rebase in progress"); git_error_set(GIT_ERROR_REBASE, "there is an existing rebase in progress");
return -1; return -1;
} }
...@@ -729,7 +729,7 @@ int git_rebase_init( ...@@ -729,7 +729,7 @@ int git_rebase_init(
rebase->repo = repo; rebase->repo = repo;
rebase->inmemory = inmemory; rebase->inmemory = inmemory;
rebase->type = GIT_REBASE_TYPE_MERGE; rebase->type = GIT_REBASE_MERGE;
if ((error = rebase_init_operations(rebase, repo, branch, upstream, onto)) < 0) if ((error = rebase_init_operations(rebase, repo, branch, upstream, onto)) < 0)
goto done; goto done;
...@@ -764,7 +764,7 @@ static void normalize_checkout_options_for_apply( ...@@ -764,7 +764,7 @@ static void normalize_checkout_options_for_apply(
if (!checkout_opts->ancestor_label) if (!checkout_opts->ancestor_label)
checkout_opts->ancestor_label = "ancestor"; checkout_opts->ancestor_label = "ancestor";
if (rebase->type == GIT_REBASE_TYPE_MERGE) { if (rebase->type == GIT_REBASE_MERGE) {
if (!checkout_opts->our_label) if (!checkout_opts->our_label)
checkout_opts->our_label = rebase->onto_name; checkout_opts->our_label = rebase->onto_name;
...@@ -917,7 +917,7 @@ int git_rebase_next( ...@@ -917,7 +917,7 @@ int git_rebase_next(
if (rebase->inmemory) if (rebase->inmemory)
error = rebase_next_inmemory(out, rebase); error = rebase_next_inmemory(out, rebase);
else if (rebase->type == GIT_REBASE_TYPE_MERGE) else if (rebase->type == GIT_REBASE_MERGE)
error = rebase_next_merge(out, rebase); error = rebase_next_merge(out, rebase);
else else
abort(); abort();
...@@ -1128,7 +1128,7 @@ int git_rebase_commit( ...@@ -1128,7 +1128,7 @@ int git_rebase_commit(
if (rebase->inmemory) if (rebase->inmemory)
error = rebase_commit_inmemory( error = rebase_commit_inmemory(
id, rebase, author, committer, message_encoding, message); id, rebase, author, committer, message_encoding, message);
else if (rebase->type == GIT_REBASE_TYPE_MERGE) else if (rebase->type == GIT_REBASE_MERGE)
error = rebase_commit_merge( error = rebase_commit_merge(
id, rebase, author, committer, message_encoding, message); id, rebase, author, committer, message_encoding, message);
else else
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment