Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit c0280bd

Browse files
committed
Merge pull request libgit2#3255 from libgit2/cmn/rename-unspecified
Rename FALLBACK to UNSPECIFIED
2 parents 552249f + c2418f4 commit c0280bd

File tree

13 files changed

+26
-26
lines changed

13 files changed

+26
-26
lines changed

CHANGELOG.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -245,7 +245,7 @@ support for HTTPS connections insead of OpenSSL.
245245
to fetch options which determine the runtime configuration.
246246

247247
* The `git_remote_autotag_option_t` values have been changed. It has
248-
gained a `_FALLBACK` default value to specify no override for the
248+
gained a `_UNSPECIFIED` default value to specify no override for the
249249
configured setting.
250250

251251
* `git_remote_update_tips()` now takes a pointer to the callbacks as

examples/status.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -387,7 +387,7 @@ static void print_short(git_repository *repo, git_status_list *status)
387387
unsigned int smstatus = 0;
388388

389389
if (!git_submodule_status(&smstatus, repo, s->index_to_workdir->new_file.path,
390-
GIT_SUBMODULE_IGNORE_FALLBACK)) {
390+
GIT_SUBMODULE_IGNORE_UNSPECIFIED)) {
391391
if (smstatus & GIT_SUBMODULE_STATUS_WD_MODIFIED)
392392
extra = " (new commits)";
393393
else if (smstatus & GIT_SUBMODULE_STATUS_WD_INDEX_MODIFIED)

include/git2/diff.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -399,7 +399,7 @@ typedef struct {
399399
* `git_diff_options_init` programmatic initialization.
400400
*/
401401
#define GIT_DIFF_OPTIONS_INIT \
402-
{GIT_DIFF_OPTIONS_VERSION, 0, GIT_SUBMODULE_IGNORE_FALLBACK, {NULL,0}, NULL, NULL, 3}
402+
{GIT_DIFF_OPTIONS_VERSION, 0, GIT_SUBMODULE_IGNORE_UNSPECIFIED, {NULL,0}, NULL, NULL, 3}
403403

404404
/**
405405
* Initializes a `git_diff_options` with default values. Equivalent to

include/git2/remote.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -475,7 +475,7 @@ typedef enum {
475475
/**
476476
* Use the setting from the configuration
477477
*/
478-
GIT_FETCH_PRUNE_FALLBACK,
478+
GIT_FETCH_PRUNE_UNSPECIFIED,
479479
/**
480480
* Force pruning on
481481
*/
@@ -495,7 +495,7 @@ typedef enum {
495495
/**
496496
* Use the setting from the configuration.
497497
*/
498-
GIT_REMOTE_DOWNLOAD_TAGS_FALLBACK = 0,
498+
GIT_REMOTE_DOWNLOAD_TAGS_UNSPECIFIED = 0,
499499
/**
500500
* Ask the server for tags pointing to objects we're already
501501
* downloading.
@@ -541,7 +541,7 @@ typedef struct {
541541
} git_fetch_options;
542542

543543
#define GIT_FETCH_OPTIONS_VERSION 1
544-
#define GIT_FETCH_OPTIONS_INIT { GIT_FETCH_OPTIONS_VERSION, GIT_REMOTE_CALLBACKS_INIT, GIT_FETCH_PRUNE_FALLBACK, 1 }
544+
#define GIT_FETCH_OPTIONS_INIT { GIT_FETCH_OPTIONS_VERSION, GIT_REMOTE_CALLBACKS_INIT, GIT_FETCH_PRUNE_UNSPECIFIED, 1 }
545545

546546
/**
547547
* Initializes a `git_fetch_options` with default values. Equivalent to

include/git2/types.h

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -383,7 +383,7 @@ typedef enum {
383383
*
384384
* The values are:
385385
*
386-
* - GIT_SUBMODULE_IGNORE_FALLBACK: use the submodule's configuration
386+
* - GIT_SUBMODULE_IGNORE_UNSPECIFIED: use the submodule's configuration
387387
* - GIT_SUBMODULE_IGNORE_NONE: don't ignore any change - i.e. even an
388388
* untracked file, will mark the submodule as dirty. Ignored files are
389389
* still ignored, of course.
@@ -397,7 +397,7 @@ typedef enum {
397397
* when we don't want any particular ignore rule to be specified.
398398
*/
399399
typedef enum {
400-
GIT_SUBMODULE_IGNORE_FALLBACK = -1, /**< use the submodule's configuration */
400+
GIT_SUBMODULE_IGNORE_UNSPECIFIED = -1, /**< use the submodule's configuration */
401401

402402
GIT_SUBMODULE_IGNORE_NONE = 1, /**< any change or untracked == dirty */
403403
GIT_SUBMODULE_IGNORE_UNTRACKED = 2, /**< dirty if tracked files change */

src/checkout.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -180,7 +180,7 @@ static bool checkout_is_workdir_modified(
180180
return true;
181181
}
182182

183-
if (git_submodule_status(&sm_status, data->repo, wditem->path, GIT_SUBMODULE_IGNORE_FALLBACK) < 0 ||
183+
if (git_submodule_status(&sm_status, data->repo, wditem->path, GIT_SUBMODULE_IGNORE_UNSPECIFIED) < 0 ||
184184
GIT_SUBMODULE_STATUS_IS_WD_DIRTY(sm_status))
185185
rval = true;
186186
else if ((sm_oid = git_submodule_wd_id(sm)) == NULL)

src/diff_file.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -186,7 +186,7 @@ static int diff_file_content_commit_to_str(
186186
return error;
187187
}
188188

189-
if ((error = git_submodule_status(&sm_status, fc->repo, fc->file->path, GIT_SUBMODULE_IGNORE_FALLBACK)) < 0) {
189+
if ((error = git_submodule_status(&sm_status, fc->repo, fc->file->path, GIT_SUBMODULE_IGNORE_UNSPECIFIED)) < 0) {
190190
git_submodule_free(sm);
191191
return error;
192192
}

src/fetch.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -60,7 +60,7 @@ static int filter_wants(git_remote *remote, const git_fetch_options *opts)
6060
size_t i, heads_len;
6161
git_remote_autotag_option_t tagopt = remote->download_tags;
6262

63-
if (opts && opts->download_tags != GIT_REMOTE_DOWNLOAD_TAGS_FALLBACK)
63+
if (opts && opts->download_tags != GIT_REMOTE_DOWNLOAD_TAGS_UNSPECIFIED)
6464
tagopt = opts->download_tags;
6565

6666
git_vector_clear(&remote->refs);

src/remote.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -985,7 +985,7 @@ int git_remote_fetch(
985985

986986
if (opts && opts->prune == GIT_FETCH_PRUNE)
987987
prune = true;
988-
else if (opts && opts->prune == GIT_FETCH_PRUNE_FALLBACK && remote->prune_refs)
988+
else if (opts && opts->prune == GIT_FETCH_PRUNE_UNSPECIFIED && remote->prune_refs)
989989
prune = true;
990990
else if (opts && opts->prune == GIT_FETCH_NO_PRUNE)
991991
prune = false;
@@ -1550,7 +1550,7 @@ int git_remote_update_tips(
15501550
if ((error = ls_to_vector(&refs, remote)) < 0)
15511551
goto out;
15521552

1553-
if (download_tags == GIT_REMOTE_DOWNLOAD_TAGS_FALLBACK)
1553+
if (download_tags == GIT_REMOTE_DOWNLOAD_TAGS_UNSPECIFIED)
15541554
tagopt = remote->download_tags;
15551555
else
15561556
tagopt = download_tags;

src/submodule.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1030,7 +1030,7 @@ int git_submodule_update(git_submodule *sm, int init, git_submodule_update_optio
10301030
memcpy(&clone_options.fetch_opts, &update_options.fetch_opts, sizeof(git_fetch_options));
10311031

10321032
/* Get the status of the submodule to determine if it is already initialized */
1033-
if ((error = git_submodule_status(&submodule_status, sm->repo, sm->name, GIT_SUBMODULE_IGNORE_FALLBACK)) < 0)
1033+
if ((error = git_submodule_status(&submodule_status, sm->repo, sm->name, GIT_SUBMODULE_IGNORE_UNSPECIFIED)) < 0)
10341034
goto done;
10351035

10361036
/*
@@ -1425,7 +1425,7 @@ int git_submodule__status(
14251425
unsigned int status;
14261426
git_repository *smrepo = NULL;
14271427

1428-
if (ign == GIT_SUBMODULE_IGNORE_FALLBACK)
1428+
if (ign == GIT_SUBMODULE_IGNORE_UNSPECIFIED)
14291429
ign = sm->ignore;
14301430

14311431
/* only return location info if ignore == all */

tests/diff/tree.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -89,7 +89,7 @@ void test_diff_tree__0(void)
8989
}
9090

9191
#define DIFF_OPTS(FLAGS, CTXT) \
92-
{GIT_DIFF_OPTIONS_VERSION, (FLAGS), GIT_SUBMODULE_IGNORE_FALLBACK, \
92+
{GIT_DIFF_OPTIONS_VERSION, (FLAGS), GIT_SUBMODULE_IGNORE_UNSPECIFIED, \
9393
{NULL,0}, NULL, NULL, (CTXT), 1}
9494

9595
void test_diff_tree__options(void)

tests/submodule/submodule_helpers.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,7 +167,7 @@ unsigned int get_submodule_status(git_repository *repo, const char *name)
167167

168168
assert(repo && name);
169169

170-
cl_git_pass(git_submodule_status(&status, repo, name, GIT_SUBMODULE_IGNORE_FALLBACK));
170+
cl_git_pass(git_submodule_status(&status, repo, name, GIT_SUBMODULE_IGNORE_UNSPECIFIED));
171171

172172
return status;
173173
}

tests/submodule/update.c

Lines changed: 9 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,7 @@ void test_submodule_update__update_submodule(void)
103103
cl_git_pass(git_submodule_lookup(&sm, g_repo, "testrepo"));
104104

105105
/* verify the initial state of the submodule */
106-
cl_git_pass(git_submodule_status(&submodule_status, g_repo, "testrepo", GIT_SUBMODULE_IGNORE_FALLBACK));
106+
cl_git_pass(git_submodule_status(&submodule_status, g_repo, "testrepo", GIT_SUBMODULE_IGNORE_UNSPECIFIED));
107107
cl_assert_equal_i(submodule_status, GIT_SUBMODULE_STATUS_IN_HEAD |
108108
GIT_SUBMODULE_STATUS_IN_INDEX |
109109
GIT_SUBMODULE_STATUS_IN_CONFIG |
@@ -114,7 +114,7 @@ void test_submodule_update__update_submodule(void)
114114
cl_git_pass(git_submodule_update(sm, 0, &update_options));
115115

116116
/* verify state */
117-
cl_git_pass(git_submodule_status(&submodule_status, g_repo, "testrepo", GIT_SUBMODULE_IGNORE_FALLBACK));
117+
cl_git_pass(git_submodule_status(&submodule_status, g_repo, "testrepo", GIT_SUBMODULE_IGNORE_UNSPECIFIED));
118118
cl_assert_equal_i(submodule_status, GIT_SUBMODULE_STATUS_IN_HEAD |
119119
GIT_SUBMODULE_STATUS_IN_INDEX |
120120
GIT_SUBMODULE_STATUS_IN_CONFIG |
@@ -142,7 +142,7 @@ void test_submodule_update__update_and_init_submodule(void)
142142
/* get the submodule */
143143
cl_git_pass(git_submodule_lookup(&sm, g_repo, "testrepo"));
144144

145-
cl_git_pass(git_submodule_status(&submodule_status, g_repo, "testrepo", GIT_SUBMODULE_IGNORE_FALLBACK));
145+
cl_git_pass(git_submodule_status(&submodule_status, g_repo, "testrepo", GIT_SUBMODULE_IGNORE_UNSPECIFIED));
146146
cl_assert_equal_i(submodule_status, GIT_SUBMODULE_STATUS_IN_HEAD |
147147
GIT_SUBMODULE_STATUS_IN_INDEX |
148148
GIT_SUBMODULE_STATUS_IN_CONFIG |
@@ -177,7 +177,7 @@ void test_submodule_update__update_already_checked_out_submodule(void)
177177
/* Initialize and update the sub repository */
178178
cl_git_pass(git_submodule_lookup(&sm, g_repo, "testrepo"));
179179

180-
cl_git_pass(git_submodule_status(&submodule_status, g_repo, "testrepo", GIT_SUBMODULE_IGNORE_FALLBACK));
180+
cl_git_pass(git_submodule_status(&submodule_status, g_repo, "testrepo", GIT_SUBMODULE_IGNORE_UNSPECIFIED));
181181
cl_assert_equal_i(submodule_status, GIT_SUBMODULE_STATUS_IN_HEAD |
182182
GIT_SUBMODULE_STATUS_IN_INDEX |
183183
GIT_SUBMODULE_STATUS_IN_CONFIG |
@@ -203,7 +203,7 @@ void test_submodule_update__update_already_checked_out_submodule(void)
203203
* HEAD commit and index should be updated, but not the workdir.
204204
*/
205205

206-
cl_git_pass(git_submodule_status(&submodule_status, g_repo, "testrepo", GIT_SUBMODULE_IGNORE_FALLBACK));
206+
cl_git_pass(git_submodule_status(&submodule_status, g_repo, "testrepo", GIT_SUBMODULE_IGNORE_UNSPECIFIED));
207207

208208
git_submodule_free(sm);
209209
cl_git_pass(git_submodule_lookup(&sm, g_repo, "testrepo"));
@@ -255,7 +255,7 @@ void test_submodule_update__update_blocks_on_dirty_wd(void)
255255
/* Initialize and update the sub repository */
256256
cl_git_pass(git_submodule_lookup(&sm, g_repo, "testrepo"));
257257

258-
cl_git_pass(git_submodule_status(&submodule_status, g_repo, "testrepo", GIT_SUBMODULE_IGNORE_FALLBACK));
258+
cl_git_pass(git_submodule_status(&submodule_status, g_repo, "testrepo", GIT_SUBMODULE_IGNORE_UNSPECIFIED));
259259
cl_assert_equal_i(submodule_status, GIT_SUBMODULE_STATUS_IN_HEAD |
260260
GIT_SUBMODULE_STATUS_IN_INDEX |
261261
GIT_SUBMODULE_STATUS_IN_CONFIG |
@@ -281,7 +281,7 @@ void test_submodule_update__update_blocks_on_dirty_wd(void)
281281
* HEAD commit and index should be updated, but not the workdir.
282282
*/
283283

284-
cl_git_pass(git_submodule_status(&submodule_status, g_repo, "testrepo", GIT_SUBMODULE_IGNORE_FALLBACK));
284+
cl_git_pass(git_submodule_status(&submodule_status, g_repo, "testrepo", GIT_SUBMODULE_IGNORE_UNSPECIFIED));
285285

286286
git_submodule_free(sm);
287287
cl_git_pass(git_submodule_lookup(&sm, g_repo, "testrepo"));
@@ -332,7 +332,7 @@ void test_submodule_update__can_force_update(void)
332332
/* Initialize and update the sub repository */
333333
cl_git_pass(git_submodule_lookup(&sm, g_repo, "testrepo"));
334334

335-
cl_git_pass(git_submodule_status(&submodule_status, g_repo, "testrepo", GIT_SUBMODULE_IGNORE_FALLBACK));
335+
cl_git_pass(git_submodule_status(&submodule_status, g_repo, "testrepo", GIT_SUBMODULE_IGNORE_UNSPECIFIED));
336336
cl_assert_equal_i(submodule_status, GIT_SUBMODULE_STATUS_IN_HEAD |
337337
GIT_SUBMODULE_STATUS_IN_INDEX |
338338
GIT_SUBMODULE_STATUS_IN_CONFIG |
@@ -357,7 +357,7 @@ void test_submodule_update__can_force_update(void)
357357
* Verify state after checkout of parent repository. The submodule ID in the
358358
* HEAD commit and index should be updated, but not the workdir.
359359
*/
360-
cl_git_pass(git_submodule_status(&submodule_status, g_repo, "testrepo", GIT_SUBMODULE_IGNORE_FALLBACK));
360+
cl_git_pass(git_submodule_status(&submodule_status, g_repo, "testrepo", GIT_SUBMODULE_IGNORE_UNSPECIFIED));
361361

362362
git_submodule_free(sm);
363363
cl_git_pass(git_submodule_lookup(&sm, g_repo, "testrepo"));

0 commit comments

Comments
 (0)