git_filter_opt_t -> git_filter_flag_t For consistency with the rest of the library, where an opt is an options *structure*.
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 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254
diff --git a/include/git2/filter.h b/include/git2/filter.h
index c0aaf15..dc59e63 100644
--- a/include/git2/filter.h
+++ b/include/git2/filter.h
@@ -39,9 +39,9 @@ typedef enum {
* Filter option flags.
*/
typedef enum {
- GIT_FILTER_OPT_DEFAULT = 0u,
- GIT_FILTER_OPT_ALLOW_UNSAFE = (1u << 0),
-} git_filter_opt_t;
+ GIT_FILTER_DEFAULT = 0u,
+ GIT_FILTER_ALLOW_UNSAFE = (1u << 0),
+} git_filter_flag_t;
/**
* A filter that can transform file data
@@ -83,7 +83,7 @@ typedef struct git_filter_list git_filter_list;
* @param blob The blob to which the filter will be applied (if known)
* @param path Relative path of the file to be filtered
* @param mode Filtering direction (WT->ODB or ODB->WT)
- * @param options Combination of `git_filter_opt_t` flags
+ * @param flags Combination of `git_filter_flag_t` flags
* @return 0 on success (which could still return NULL if no filters are
* needed for the requested file), <0 on error
*/
@@ -93,7 +93,7 @@ GIT_EXTERN(int) git_filter_list_load(
git_blob *blob, /* can be NULL */
const char *path,
git_filter_mode_t mode,
- uint32_t options);
+ uint32_t flags);
/**
* Apply filter list to a data buffer.
diff --git a/include/git2/sys/filter.h b/include/git2/sys/filter.h
index 9b560fa..5fd8d55 100644
--- a/include/git2/sys/filter.h
+++ b/include/git2/sys/filter.h
@@ -123,9 +123,9 @@ GIT_EXTERN(const git_oid *) git_filter_source_id(const git_filter_source *src);
GIT_EXTERN(git_filter_mode_t) git_filter_source_mode(const git_filter_source *src);
/**
- * Get the combination git_filter_opt_t options to be applied
+ * Get the combination git_filter_flag_t options to be applied
*/
-GIT_EXTERN(uint32_t) git_filter_source_options(const git_filter_source *src);
+GIT_EXTERN(uint32_t) git_filter_source_flags(const git_filter_source *src);
/*
* struct git_filter
diff --git a/src/blob.c b/src/blob.c
index ba8769c..cf03290 100644
--- a/src/blob.c
+++ b/src/blob.c
@@ -199,7 +199,7 @@ int git_blob__create_from_paths(
/* Load the filters for writing this file to the ODB */
error = git_filter_list_load(
&fl, repo, NULL, hint_path,
- GIT_FILTER_TO_ODB, GIT_FILTER_OPT_DEFAULT);
+ GIT_FILTER_TO_ODB, GIT_FILTER_DEFAULT);
if (error < 0)
/* well, that didn't work */;
@@ -357,7 +357,7 @@ int git_blob_filtered_content(
if (!(error = git_filter_list_load(
&fl, git_blob_owner(blob), blob, path,
- GIT_FILTER_TO_WORKTREE, GIT_FILTER_OPT_DEFAULT))) {
+ GIT_FILTER_TO_WORKTREE, GIT_FILTER_DEFAULT))) {
error = git_filter_list_apply_to_blob(out, fl, blob);
diff --git a/src/checkout.c b/src/checkout.c
index e48a855..a4dd209 100644
--- a/src/checkout.c
+++ b/src/checkout.c
@@ -1441,7 +1441,7 @@ static int blob_content_to_file(
if (!data->opts.disable_filters &&
(error = git_filter_list__load_with_attr_session(
&fl, data->repo, &data->attr_session, blob, hint_path,
- GIT_FILTER_TO_WORKTREE, GIT_FILTER_OPT_DEFAULT)))
+ GIT_FILTER_TO_WORKTREE, GIT_FILTER_DEFAULT)))
return error;
if (fl)
@@ -2054,7 +2054,7 @@ static int checkout_write_merge(
if ((error = git_filter_list__load_with_attr_session(
&fl, data->repo, &data->attr_session, NULL, git_buf_cstr(&path_workdir),
- GIT_FILTER_TO_WORKTREE, GIT_FILTER_OPT_DEFAULT)) < 0 ||
+ GIT_FILTER_TO_WORKTREE, GIT_FILTER_DEFAULT)) < 0 ||
(error = git_filter_list_apply_to_data(&out_data, fl, &in_data)) < 0)
goto done;
} else {
diff --git a/src/crlf.c b/src/crlf.c
index c0a7399..b5d1dbf 100644
--- a/src/crlf.c
+++ b/src/crlf.c
@@ -302,7 +302,7 @@ static int crlf_check(
return error;
/* downgrade FAIL to WARN if ALLOW_UNSAFE option is used */
- if ((git_filter_source_options(src) & GIT_FILTER_OPT_ALLOW_UNSAFE) &&
+ if ((git_filter_source_flags(src) & GIT_FILTER_ALLOW_UNSAFE) &&
ca.safe_crlf == GIT_SAFE_CRLF_FAIL)
ca.safe_crlf = GIT_SAFE_CRLF_WARN;
}
diff --git a/src/diff.c b/src/diff.c
index 07eae03..815351b 100644
--- a/src/diff.c
+++ b/src/diff.c
@@ -600,7 +600,7 @@ int git_diff__oid_for_entry(
error = -1;
} else if (!(error = git_filter_list_load(
&fl, diff->repo, NULL, entry.path,
- GIT_FILTER_TO_ODB, GIT_FILTER_OPT_ALLOW_UNSAFE)))
+ GIT_FILTER_TO_ODB, GIT_FILTER_ALLOW_UNSAFE)))
{
int fd = git_futils_open_ro(full_path.ptr);
if (fd < 0)
diff --git a/src/diff_file.c b/src/diff_file.c
index 96be094..f7061ae 100644
--- a/src/diff_file.c
+++ b/src/diff_file.c
@@ -302,7 +302,7 @@ static int diff_file_content_load_workdir_file(
if ((error = git_filter_list_load(
&fl, fc->repo, NULL, fc->file->path,
- GIT_FILTER_TO_ODB, GIT_FILTER_OPT_ALLOW_UNSAFE)) < 0)
+ GIT_FILTER_TO_ODB, GIT_FILTER_ALLOW_UNSAFE)) < 0)
goto cleanup;
/* if there are no filters, try to mmap the file */
diff --git a/src/filter.c b/src/filter.c
index 4009a61..88877fe 100644
--- a/src/filter.c
+++ b/src/filter.c
@@ -23,7 +23,7 @@ struct git_filter_source {
git_oid oid; /* zero if unknown (which is likely) */
uint16_t filemode; /* zero if unknown */
git_filter_mode_t mode;
- uint32_t options;
+ uint32_t flags;
};
typedef struct {
@@ -372,9 +372,9 @@ git_filter_mode_t git_filter_source_mode(const git_filter_source *src)
return src->mode;
}
-uint32_t git_filter_source_options(const git_filter_source *src)
+uint32_t git_filter_source_flags(const git_filter_source *src)
{
- return src->options;
+ return src->flags;
}
static int filter_list_new(
@@ -394,7 +394,7 @@ static int filter_list_new(
fl->source.repo = src->repo;
fl->source.path = fl->path;
fl->source.mode = src->mode;
- fl->source.options = src->options;
+ fl->source.flags = src->flags;
*out = fl;
return 0;
@@ -449,13 +449,13 @@ int git_filter_list_new(
git_filter_list **out,
git_repository *repo,
git_filter_mode_t mode,
- uint32_t options)
+ uint32_t flags)
{
git_filter_source src = { 0 };
src.repo = repo;
src.path = NULL;
src.mode = mode;
- src.options = options;
+ src.flags = flags;
return filter_list_new(out, &src);
}
@@ -466,7 +466,7 @@ int git_filter_list__load_with_attr_session(
git_blob *blob, /* can be NULL */
const char *path,
git_filter_mode_t mode,
- uint32_t options)
+ uint32_t flags)
{
int error = 0;
git_filter_list *fl = NULL;
@@ -481,7 +481,7 @@ int git_filter_list__load_with_attr_session(
src.repo = repo;
src.path = path;
src.mode = mode;
- src.options = options;
+ src.flags = flags;
if (blob)
git_oid_cpy(&src.oid, git_blob_id(blob));
@@ -543,10 +543,10 @@ int git_filter_list_load(
git_blob *blob, /* can be NULL */
const char *path,
git_filter_mode_t mode,
- uint32_t options)
+ uint32_t flags)
{
return git_filter_list__load_with_attr_session(
- filters, repo, NULL, blob, path, mode, options);
+ filters, repo, NULL, blob, path, mode, flags);
}
void git_filter_list__set_temp_buf(git_filter_list *fl, git_buf *temp_buf)
diff --git a/src/filter.h b/src/filter.h
index 53f3afd..a38c6c8 100644
--- a/src/filter.h
+++ b/src/filter.h
@@ -36,7 +36,7 @@ extern int git_filter_list__load_with_attr_session(
git_blob *blob, /* can be NULL */
const char *path,
git_filter_mode_t mode,
- uint32_t options);
+ uint32_t flags);
/*
* Available filters
diff --git a/src/repository.c b/src/repository.c
index c927507..23c99b0 100644
--- a/src/repository.c
+++ b/src/repository.c
@@ -1849,7 +1849,7 @@ int git_repository_hashfile(
if (strlen(as_path) > 0) {
error = git_filter_list_load(
&fl, repo, NULL, as_path,
- GIT_FILTER_TO_ODB, GIT_FILTER_OPT_DEFAULT);
+ GIT_FILTER_TO_ODB, GIT_FILTER_DEFAULT);
if (error < 0)
return error;
} else {
diff --git a/tests/filter/crlf.c b/tests/filter/crlf.c
index a31dac9..406d3b6 100644
--- a/tests/filter/crlf.c
+++ b/tests/filter/crlf.c
@@ -123,7 +123,7 @@ void test_filter_crlf__with_safecrlf_and_unsafe_allowed(void)
cl_repo_set_bool(g_repo, "core.safecrlf", true);
cl_git_pass(git_filter_list_new(
- &fl, g_repo, GIT_FILTER_TO_ODB, GIT_FILTER_OPT_ALLOW_UNSAFE));
+ &fl, g_repo, GIT_FILTER_TO_ODB, GIT_FILTER_ALLOW_UNSAFE));
crlf = git_filter_lookup(GIT_FILTER_CRLF);
cl_assert(crlf != NULL);