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.
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 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146
diff --git a/src/rebase.c b/src/rebase.c
index d171fa2..0a38807 100644
--- a/src/rebase.c
+++ b/src/rebase.c
@@ -49,18 +49,18 @@
#define REBASE_FILE_MODE 0666
typedef enum {
- GIT_REBASE_TYPE_NONE = 0,
- GIT_REBASE_TYPE_APPLY = 1,
- GIT_REBASE_TYPE_MERGE = 2,
- GIT_REBASE_TYPE_INTERACTIVE = 3,
-} git_rebase_type_t;
+ GIT_REBASE_NONE = 0,
+ GIT_REBASE_APPLY = 1,
+ GIT_REBASE_MERGE = 2,
+ GIT_REBASE_INTERACTIVE = 3,
+} git_rebase_t;
struct git_rebase {
git_repository *repo;
git_rebase_options options;
- git_rebase_type_t type;
+ git_rebase_t type;
char *state_path;
int head_detached : 1,
@@ -86,18 +86,18 @@ struct git_rebase {
#define GIT_REBASE_STATE_INIT {0}
static int rebase_state_type(
- git_rebase_type_t *type_out,
+ git_rebase_t *type_out,
char **path_out,
git_repository *repo)
{
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)
return -1;
if (git_path_isdir(git_buf_cstr(&path))) {
- type = GIT_REBASE_TYPE_APPLY;
+ type = GIT_REBASE_APPLY;
goto done;
}
@@ -106,14 +106,14 @@ static int rebase_state_type(
return -1;
if (git_path_isdir(git_buf_cstr(&path))) {
- type = GIT_REBASE_TYPE_MERGE;
+ type = GIT_REBASE_MERGE;
goto done;
}
done:
*type_out = type;
- if (type != GIT_REBASE_TYPE_NONE && path_out)
+ if (type != GIT_REBASE_NONE && path_out)
*path_out = git_buf_detach(&path);
git_buf_dispose(&path);
@@ -314,7 +314,7 @@ int git_rebase_open(
if ((error = rebase_state_type(&rebase->type, &rebase->state_path, repo)) < 0)
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");
error = GIT_ENOTFOUND;
goto done;
@@ -370,14 +370,14 @@ int git_rebase_open(
rebase->orig_head_name = git_buf_detach(&orig_head_name);
switch (rebase->type) {
- case GIT_REBASE_TYPE_INTERACTIVE:
+ case GIT_REBASE_INTERACTIVE:
git_error_set(GIT_ERROR_REBASE, "interactive rebase is not supported");
error = -1;
break;
- case GIT_REBASE_TYPE_MERGE:
+ case GIT_REBASE_MERGE:
error = rebase_open_merge(rebase);
break;
- case GIT_REBASE_TYPE_APPLY:
+ case GIT_REBASE_APPLY:
git_error_set(GIT_ERROR_REBASE, "patch application rebase is not supported");
error = -1;
break;
@@ -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)
{
int error;
- git_rebase_type_t type;
+ git_rebase_t type;
if ((error = rebase_state_type(&type, NULL, repo)) < 0)
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");
return -1;
}
@@ -729,7 +729,7 @@ int git_rebase_init(
rebase->repo = repo;
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)
goto done;
@@ -764,7 +764,7 @@ static void normalize_checkout_options_for_apply(
if (!checkout_opts->ancestor_label)
checkout_opts->ancestor_label = "ancestor";
- if (rebase->type == GIT_REBASE_TYPE_MERGE) {
+ if (rebase->type == GIT_REBASE_MERGE) {
if (!checkout_opts->our_label)
checkout_opts->our_label = rebase->onto_name;
@@ -917,7 +917,7 @@ int git_rebase_next(
if (rebase->inmemory)
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);
else
abort();
@@ -1128,7 +1128,7 @@ int git_rebase_commit(
if (rebase->inmemory)
error = rebase_commit_inmemory(
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(
id, rebase, author, committer, message_encoding, message);
else