Rename FALLBACK to UNSPECIFIED Fallback describes the mechanism, while unspecified explains what the user is thinking.
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 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286
diff --git a/CHANGELOG.md b/CHANGELOG.md
index 86f9955..49da917 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -242,7 +242,7 @@ support for HTTPS connections insead of OpenSSL.
to fetch options which determine the runtime configuration.
* The `git_remote_autotag_option_t` values have been changed. It has
- gained a `_FALLBACK` default value to specify no override for the
+ gained a `_UNSPECIFIED` default value to specify no override for the
configured setting.
* `git_remote_update_tips()` now takes a pointer to the callbacks as
diff --git a/examples/status.c b/examples/status.c
index 8e242dd..49f006d 100644
--- a/examples/status.c
+++ b/examples/status.c
@@ -387,7 +387,7 @@ static void print_short(git_repository *repo, git_status_list *status)
unsigned int smstatus = 0;
if (!git_submodule_status(&smstatus, repo, s->index_to_workdir->new_file.path,
- GIT_SUBMODULE_IGNORE_FALLBACK)) {
+ GIT_SUBMODULE_IGNORE_UNSPECIFIED)) {
if (smstatus & GIT_SUBMODULE_STATUS_WD_MODIFIED)
extra = " (new commits)";
else if (smstatus & GIT_SUBMODULE_STATUS_WD_INDEX_MODIFIED)
diff --git a/include/git2/diff.h b/include/git2/diff.h
index 90e2e1b..b3ab539 100644
--- a/include/git2/diff.h
+++ b/include/git2/diff.h
@@ -399,7 +399,7 @@ typedef struct {
* `git_diff_options_init` programmatic initialization.
*/
#define GIT_DIFF_OPTIONS_INIT \
- {GIT_DIFF_OPTIONS_VERSION, 0, GIT_SUBMODULE_IGNORE_FALLBACK, {NULL,0}, NULL, NULL, 3}
+ {GIT_DIFF_OPTIONS_VERSION, 0, GIT_SUBMODULE_IGNORE_UNSPECIFIED, {NULL,0}, NULL, NULL, 3}
/**
* Initializes a `git_diff_options` with default values. Equivalent to
diff --git a/include/git2/remote.h b/include/git2/remote.h
index ccd0b43..e47f008 100644
--- a/include/git2/remote.h
+++ b/include/git2/remote.h
@@ -475,7 +475,7 @@ typedef enum {
/**
* Use the setting from the configuration
*/
- GIT_FETCH_PRUNE_FALLBACK,
+ GIT_FETCH_PRUNE_UNSPECIFIED,
/**
* Force pruning on
*/
@@ -495,7 +495,7 @@ typedef enum {
/**
* Use the setting from the configuration.
*/
- GIT_REMOTE_DOWNLOAD_TAGS_FALLBACK = 0,
+ GIT_REMOTE_DOWNLOAD_TAGS_UNSPECIFIED = 0,
/**
* Ask the server for tags pointing to objects we're already
* downloading.
@@ -541,7 +541,7 @@ typedef struct {
} git_fetch_options;
#define GIT_FETCH_OPTIONS_VERSION 1
-#define GIT_FETCH_OPTIONS_INIT { GIT_FETCH_OPTIONS_VERSION, GIT_REMOTE_CALLBACKS_INIT, GIT_FETCH_PRUNE_FALLBACK, 1 }
+#define GIT_FETCH_OPTIONS_INIT { GIT_FETCH_OPTIONS_VERSION, GIT_REMOTE_CALLBACKS_INIT, GIT_FETCH_PRUNE_UNSPECIFIED, 1 }
/**
* Initializes a `git_fetch_options` with default values. Equivalent to
diff --git a/include/git2/types.h b/include/git2/types.h
index e975c60..6f41014 100644
--- a/include/git2/types.h
+++ b/include/git2/types.h
@@ -383,7 +383,7 @@ typedef enum {
*
* The values are:
*
- * - GIT_SUBMODULE_IGNORE_FALLBACK: use the submodule's configuration
+ * - GIT_SUBMODULE_IGNORE_UNSPECIFIED: use the submodule's configuration
* - GIT_SUBMODULE_IGNORE_NONE: don't ignore any change - i.e. even an
* untracked file, will mark the submodule as dirty. Ignored files are
* still ignored, of course.
@@ -397,7 +397,7 @@ typedef enum {
* when we don't want any particular ignore rule to be specified.
*/
typedef enum {
- GIT_SUBMODULE_IGNORE_FALLBACK = -1, /**< use the submodule's configuration */
+ GIT_SUBMODULE_IGNORE_UNSPECIFIED = -1, /**< use the submodule's configuration */
GIT_SUBMODULE_IGNORE_NONE = 1, /**< any change or untracked == dirty */
GIT_SUBMODULE_IGNORE_UNTRACKED = 2, /**< dirty if tracked files change */
diff --git a/src/checkout.c b/src/checkout.c
index 351e8b0..a94d509 100644
--- a/src/checkout.c
+++ b/src/checkout.c
@@ -180,7 +180,7 @@ static bool checkout_is_workdir_modified(
return true;
}
- if (git_submodule_status(&sm_status, data->repo, wditem->path, GIT_SUBMODULE_IGNORE_FALLBACK) < 0 ||
+ if (git_submodule_status(&sm_status, data->repo, wditem->path, GIT_SUBMODULE_IGNORE_UNSPECIFIED) < 0 ||
GIT_SUBMODULE_STATUS_IS_WD_DIRTY(sm_status))
rval = true;
else if ((sm_oid = git_submodule_wd_id(sm)) == NULL)
diff --git a/src/diff_file.c b/src/diff_file.c
index 28edcd4..c603628 100644
--- a/src/diff_file.c
+++ b/src/diff_file.c
@@ -186,7 +186,7 @@ static int diff_file_content_commit_to_str(
return error;
}
- if ((error = git_submodule_status(&sm_status, fc->repo, fc->file->path, GIT_SUBMODULE_IGNORE_FALLBACK)) < 0) {
+ if ((error = git_submodule_status(&sm_status, fc->repo, fc->file->path, GIT_SUBMODULE_IGNORE_UNSPECIFIED)) < 0) {
git_submodule_free(sm);
return error;
}
diff --git a/src/fetch.c b/src/fetch.c
index 82d86bb..4d89575 100644
--- a/src/fetch.c
+++ b/src/fetch.c
@@ -60,7 +60,7 @@ static int filter_wants(git_remote *remote, const git_fetch_options *opts)
size_t i, heads_len;
git_remote_autotag_option_t tagopt = remote->download_tags;
- if (opts && opts->download_tags != GIT_REMOTE_DOWNLOAD_TAGS_FALLBACK)
+ if (opts && opts->download_tags != GIT_REMOTE_DOWNLOAD_TAGS_UNSPECIFIED)
tagopt = opts->download_tags;
git_vector_clear(&remote->refs);
diff --git a/src/remote.c b/src/remote.c
index 7c2d999..4dbcb3b 100644
--- a/src/remote.c
+++ b/src/remote.c
@@ -985,7 +985,7 @@ int git_remote_fetch(
if (opts && opts->prune == GIT_FETCH_PRUNE)
prune = true;
- else if (opts && opts->prune == GIT_FETCH_PRUNE_FALLBACK && remote->prune_refs)
+ else if (opts && opts->prune == GIT_FETCH_PRUNE_UNSPECIFIED && remote->prune_refs)
prune = true;
else if (opts && opts->prune == GIT_FETCH_NO_PRUNE)
prune = false;
@@ -1539,7 +1539,7 @@ int git_remote_update_tips(
if ((error = ls_to_vector(&refs, remote)) < 0)
goto out;
- if (download_tags == GIT_REMOTE_DOWNLOAD_TAGS_FALLBACK)
+ if (download_tags == GIT_REMOTE_DOWNLOAD_TAGS_UNSPECIFIED)
tagopt = remote->download_tags;
else
tagopt = download_tags;
diff --git a/src/submodule.c b/src/submodule.c
index 45163da..796364b 100644
--- a/src/submodule.c
+++ b/src/submodule.c
@@ -1030,7 +1030,7 @@ int git_submodule_update(git_submodule *sm, int init, git_submodule_update_optio
memcpy(&clone_options.fetch_opts, &update_options.fetch_opts, sizeof(git_fetch_options));
/* Get the status of the submodule to determine if it is already initialized */
- if ((error = git_submodule_status(&submodule_status, sm->repo, sm->name, GIT_SUBMODULE_IGNORE_FALLBACK)) < 0)
+ if ((error = git_submodule_status(&submodule_status, sm->repo, sm->name, GIT_SUBMODULE_IGNORE_UNSPECIFIED)) < 0)
goto done;
/*
@@ -1425,7 +1425,7 @@ int git_submodule__status(
unsigned int status;
git_repository *smrepo = NULL;
- if (ign == GIT_SUBMODULE_IGNORE_FALLBACK)
+ if (ign == GIT_SUBMODULE_IGNORE_UNSPECIFIED)
ign = sm->ignore;
/* only return location info if ignore == all */
diff --git a/tests/diff/tree.c b/tests/diff/tree.c
index 977e21f..2bc9e6a 100644
--- a/tests/diff/tree.c
+++ b/tests/diff/tree.c
@@ -89,7 +89,7 @@ void test_diff_tree__0(void)
}
#define DIFF_OPTS(FLAGS, CTXT) \
- {GIT_DIFF_OPTIONS_VERSION, (FLAGS), GIT_SUBMODULE_IGNORE_FALLBACK, \
+ {GIT_DIFF_OPTIONS_VERSION, (FLAGS), GIT_SUBMODULE_IGNORE_UNSPECIFIED, \
{NULL,0}, NULL, NULL, (CTXT), 1}
void test_diff_tree__options(void)
diff --git a/tests/submodule/submodule_helpers.c b/tests/submodule/submodule_helpers.c
index 2647e15..1dc6872 100644
--- a/tests/submodule/submodule_helpers.c
+++ b/tests/submodule/submodule_helpers.c
@@ -167,7 +167,7 @@ unsigned int get_submodule_status(git_repository *repo, const char *name)
assert(repo && name);
- cl_git_pass(git_submodule_status(&status, repo, name, GIT_SUBMODULE_IGNORE_FALLBACK));
+ cl_git_pass(git_submodule_status(&status, repo, name, GIT_SUBMODULE_IGNORE_UNSPECIFIED));
return status;
}
diff --git a/tests/submodule/update.c b/tests/submodule/update.c
index fed6d38..40d24d0 100644
--- a/tests/submodule/update.c
+++ b/tests/submodule/update.c
@@ -103,7 +103,7 @@ void test_submodule_update__update_submodule(void)
cl_git_pass(git_submodule_lookup(&sm, g_repo, "testrepo"));
/* verify the initial state of the submodule */
- cl_git_pass(git_submodule_status(&submodule_status, g_repo, "testrepo", GIT_SUBMODULE_IGNORE_FALLBACK));
+ cl_git_pass(git_submodule_status(&submodule_status, g_repo, "testrepo", GIT_SUBMODULE_IGNORE_UNSPECIFIED));
cl_assert_equal_i(submodule_status, GIT_SUBMODULE_STATUS_IN_HEAD |
GIT_SUBMODULE_STATUS_IN_INDEX |
GIT_SUBMODULE_STATUS_IN_CONFIG |
@@ -114,7 +114,7 @@ void test_submodule_update__update_submodule(void)
cl_git_pass(git_submodule_update(sm, 0, &update_options));
/* verify state */
- cl_git_pass(git_submodule_status(&submodule_status, g_repo, "testrepo", GIT_SUBMODULE_IGNORE_FALLBACK));
+ cl_git_pass(git_submodule_status(&submodule_status, g_repo, "testrepo", GIT_SUBMODULE_IGNORE_UNSPECIFIED));
cl_assert_equal_i(submodule_status, GIT_SUBMODULE_STATUS_IN_HEAD |
GIT_SUBMODULE_STATUS_IN_INDEX |
GIT_SUBMODULE_STATUS_IN_CONFIG |
@@ -142,7 +142,7 @@ void test_submodule_update__update_and_init_submodule(void)
/* get the submodule */
cl_git_pass(git_submodule_lookup(&sm, g_repo, "testrepo"));
- cl_git_pass(git_submodule_status(&submodule_status, g_repo, "testrepo", GIT_SUBMODULE_IGNORE_FALLBACK));
+ cl_git_pass(git_submodule_status(&submodule_status, g_repo, "testrepo", GIT_SUBMODULE_IGNORE_UNSPECIFIED));
cl_assert_equal_i(submodule_status, GIT_SUBMODULE_STATUS_IN_HEAD |
GIT_SUBMODULE_STATUS_IN_INDEX |
GIT_SUBMODULE_STATUS_IN_CONFIG |
@@ -177,7 +177,7 @@ void test_submodule_update__update_already_checked_out_submodule(void)
/* Initialize and update the sub repository */
cl_git_pass(git_submodule_lookup(&sm, g_repo, "testrepo"));
- cl_git_pass(git_submodule_status(&submodule_status, g_repo, "testrepo", GIT_SUBMODULE_IGNORE_FALLBACK));
+ cl_git_pass(git_submodule_status(&submodule_status, g_repo, "testrepo", GIT_SUBMODULE_IGNORE_UNSPECIFIED));
cl_assert_equal_i(submodule_status, GIT_SUBMODULE_STATUS_IN_HEAD |
GIT_SUBMODULE_STATUS_IN_INDEX |
GIT_SUBMODULE_STATUS_IN_CONFIG |
@@ -203,7 +203,7 @@ void test_submodule_update__update_already_checked_out_submodule(void)
* HEAD commit and index should be updated, but not the workdir.
*/
- cl_git_pass(git_submodule_status(&submodule_status, g_repo, "testrepo", GIT_SUBMODULE_IGNORE_FALLBACK));
+ cl_git_pass(git_submodule_status(&submodule_status, g_repo, "testrepo", GIT_SUBMODULE_IGNORE_UNSPECIFIED));
git_submodule_free(sm);
cl_git_pass(git_submodule_lookup(&sm, g_repo, "testrepo"));
@@ -255,7 +255,7 @@ void test_submodule_update__update_blocks_on_dirty_wd(void)
/* Initialize and update the sub repository */
cl_git_pass(git_submodule_lookup(&sm, g_repo, "testrepo"));
- cl_git_pass(git_submodule_status(&submodule_status, g_repo, "testrepo", GIT_SUBMODULE_IGNORE_FALLBACK));
+ cl_git_pass(git_submodule_status(&submodule_status, g_repo, "testrepo", GIT_SUBMODULE_IGNORE_UNSPECIFIED));
cl_assert_equal_i(submodule_status, GIT_SUBMODULE_STATUS_IN_HEAD |
GIT_SUBMODULE_STATUS_IN_INDEX |
GIT_SUBMODULE_STATUS_IN_CONFIG |
@@ -281,7 +281,7 @@ void test_submodule_update__update_blocks_on_dirty_wd(void)
* HEAD commit and index should be updated, but not the workdir.
*/
- cl_git_pass(git_submodule_status(&submodule_status, g_repo, "testrepo", GIT_SUBMODULE_IGNORE_FALLBACK));
+ cl_git_pass(git_submodule_status(&submodule_status, g_repo, "testrepo", GIT_SUBMODULE_IGNORE_UNSPECIFIED));
git_submodule_free(sm);
cl_git_pass(git_submodule_lookup(&sm, g_repo, "testrepo"));
@@ -332,7 +332,7 @@ void test_submodule_update__can_force_update(void)
/* Initialize and update the sub repository */
cl_git_pass(git_submodule_lookup(&sm, g_repo, "testrepo"));
- cl_git_pass(git_submodule_status(&submodule_status, g_repo, "testrepo", GIT_SUBMODULE_IGNORE_FALLBACK));
+ cl_git_pass(git_submodule_status(&submodule_status, g_repo, "testrepo", GIT_SUBMODULE_IGNORE_UNSPECIFIED));
cl_assert_equal_i(submodule_status, GIT_SUBMODULE_STATUS_IN_HEAD |
GIT_SUBMODULE_STATUS_IN_INDEX |
GIT_SUBMODULE_STATUS_IN_CONFIG |
@@ -357,7 +357,7 @@ void test_submodule_update__can_force_update(void)
* Verify state after checkout of parent repository. The submodule ID in the
* HEAD commit and index should be updated, but not the workdir.
*/
- cl_git_pass(git_submodule_status(&submodule_status, g_repo, "testrepo", GIT_SUBMODULE_IGNORE_FALLBACK));
+ cl_git_pass(git_submodule_status(&submodule_status, g_repo, "testrepo", GIT_SUBMODULE_IGNORE_UNSPECIFIED));
git_submodule_free(sm);
cl_git_pass(git_submodule_lookup(&sm, g_repo, "testrepo"));