Commit c0280bdd by Edward Thomson

Merge pull request #3255 from libgit2/cmn/rename-unspecified

Rename FALLBACK to UNSPECIFIED
parents 552249f9 c2418f46
...@@ -245,7 +245,7 @@ support for HTTPS connections insead of OpenSSL. ...@@ -245,7 +245,7 @@ support for HTTPS connections insead of OpenSSL.
to fetch options which determine the runtime configuration. to fetch options which determine the runtime configuration.
* The `git_remote_autotag_option_t` values have been changed. It has * 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. configured setting.
* `git_remote_update_tips()` now takes a pointer to the callbacks as * `git_remote_update_tips()` now takes a pointer to the callbacks as
......
...@@ -387,7 +387,7 @@ static void print_short(git_repository *repo, git_status_list *status) ...@@ -387,7 +387,7 @@ static void print_short(git_repository *repo, git_status_list *status)
unsigned int smstatus = 0; unsigned int smstatus = 0;
if (!git_submodule_status(&smstatus, repo, s->index_to_workdir->new_file.path, 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) if (smstatus & GIT_SUBMODULE_STATUS_WD_MODIFIED)
extra = " (new commits)"; extra = " (new commits)";
else if (smstatus & GIT_SUBMODULE_STATUS_WD_INDEX_MODIFIED) else if (smstatus & GIT_SUBMODULE_STATUS_WD_INDEX_MODIFIED)
......
...@@ -399,7 +399,7 @@ typedef struct { ...@@ -399,7 +399,7 @@ typedef struct {
* `git_diff_options_init` programmatic initialization. * `git_diff_options_init` programmatic initialization.
*/ */
#define GIT_DIFF_OPTIONS_INIT \ #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 * Initializes a `git_diff_options` with default values. Equivalent to
......
...@@ -475,7 +475,7 @@ typedef enum { ...@@ -475,7 +475,7 @@ typedef enum {
/** /**
* Use the setting from the configuration * Use the setting from the configuration
*/ */
GIT_FETCH_PRUNE_FALLBACK, GIT_FETCH_PRUNE_UNSPECIFIED,
/** /**
* Force pruning on * Force pruning on
*/ */
...@@ -495,7 +495,7 @@ typedef enum { ...@@ -495,7 +495,7 @@ typedef enum {
/** /**
* Use the setting from the configuration. * 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 * Ask the server for tags pointing to objects we're already
* downloading. * downloading.
...@@ -541,7 +541,7 @@ typedef struct { ...@@ -541,7 +541,7 @@ typedef struct {
} git_fetch_options; } git_fetch_options;
#define GIT_FETCH_OPTIONS_VERSION 1 #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 * Initializes a `git_fetch_options` with default values. Equivalent to
......
...@@ -383,7 +383,7 @@ typedef enum { ...@@ -383,7 +383,7 @@ typedef enum {
* *
* The values are: * 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 * - GIT_SUBMODULE_IGNORE_NONE: don't ignore any change - i.e. even an
* untracked file, will mark the submodule as dirty. Ignored files are * untracked file, will mark the submodule as dirty. Ignored files are
* still ignored, of course. * still ignored, of course.
...@@ -397,7 +397,7 @@ typedef enum { ...@@ -397,7 +397,7 @@ typedef enum {
* when we don't want any particular ignore rule to be specified. * when we don't want any particular ignore rule to be specified.
*/ */
typedef enum { 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_NONE = 1, /**< any change or untracked == dirty */
GIT_SUBMODULE_IGNORE_UNTRACKED = 2, /**< dirty if tracked files change */ GIT_SUBMODULE_IGNORE_UNTRACKED = 2, /**< dirty if tracked files change */
......
...@@ -180,7 +180,7 @@ static bool checkout_is_workdir_modified( ...@@ -180,7 +180,7 @@ static bool checkout_is_workdir_modified(
return true; 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)) GIT_SUBMODULE_STATUS_IS_WD_DIRTY(sm_status))
rval = true; rval = true;
else if ((sm_oid = git_submodule_wd_id(sm)) == NULL) else if ((sm_oid = git_submodule_wd_id(sm)) == NULL)
......
...@@ -186,7 +186,7 @@ static int diff_file_content_commit_to_str( ...@@ -186,7 +186,7 @@ static int diff_file_content_commit_to_str(
return error; 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); git_submodule_free(sm);
return error; return error;
} }
......
...@@ -60,7 +60,7 @@ static int filter_wants(git_remote *remote, const git_fetch_options *opts) ...@@ -60,7 +60,7 @@ static int filter_wants(git_remote *remote, const git_fetch_options *opts)
size_t i, heads_len; size_t i, heads_len;
git_remote_autotag_option_t tagopt = remote->download_tags; 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; tagopt = opts->download_tags;
git_vector_clear(&remote->refs); git_vector_clear(&remote->refs);
......
...@@ -985,7 +985,7 @@ int git_remote_fetch( ...@@ -985,7 +985,7 @@ int git_remote_fetch(
if (opts && opts->prune == GIT_FETCH_PRUNE) if (opts && opts->prune == GIT_FETCH_PRUNE)
prune = true; 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; prune = true;
else if (opts && opts->prune == GIT_FETCH_NO_PRUNE) else if (opts && opts->prune == GIT_FETCH_NO_PRUNE)
prune = false; prune = false;
...@@ -1550,7 +1550,7 @@ int git_remote_update_tips( ...@@ -1550,7 +1550,7 @@ int git_remote_update_tips(
if ((error = ls_to_vector(&refs, remote)) < 0) if ((error = ls_to_vector(&refs, remote)) < 0)
goto out; goto out;
if (download_tags == GIT_REMOTE_DOWNLOAD_TAGS_FALLBACK) if (download_tags == GIT_REMOTE_DOWNLOAD_TAGS_UNSPECIFIED)
tagopt = remote->download_tags; tagopt = remote->download_tags;
else else
tagopt = download_tags; tagopt = download_tags;
......
...@@ -1030,7 +1030,7 @@ int git_submodule_update(git_submodule *sm, int init, git_submodule_update_optio ...@@ -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)); 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 */ /* 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; goto done;
/* /*
...@@ -1425,7 +1425,7 @@ int git_submodule__status( ...@@ -1425,7 +1425,7 @@ int git_submodule__status(
unsigned int status; unsigned int status;
git_repository *smrepo = NULL; git_repository *smrepo = NULL;
if (ign == GIT_SUBMODULE_IGNORE_FALLBACK) if (ign == GIT_SUBMODULE_IGNORE_UNSPECIFIED)
ign = sm->ignore; ign = sm->ignore;
/* only return location info if ignore == all */ /* only return location info if ignore == all */
......
...@@ -89,7 +89,7 @@ void test_diff_tree__0(void) ...@@ -89,7 +89,7 @@ void test_diff_tree__0(void)
} }
#define DIFF_OPTS(FLAGS, CTXT) \ #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} {NULL,0}, NULL, NULL, (CTXT), 1}
void test_diff_tree__options(void) void test_diff_tree__options(void)
......
...@@ -167,7 +167,7 @@ unsigned int get_submodule_status(git_repository *repo, const char *name) ...@@ -167,7 +167,7 @@ unsigned int get_submodule_status(git_repository *repo, const char *name)
assert(repo && 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; return status;
} }
......
...@@ -103,7 +103,7 @@ void test_submodule_update__update_submodule(void) ...@@ -103,7 +103,7 @@ void test_submodule_update__update_submodule(void)
cl_git_pass(git_submodule_lookup(&sm, g_repo, "testrepo")); cl_git_pass(git_submodule_lookup(&sm, g_repo, "testrepo"));
/* verify the initial state of the submodule */ /* 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 | cl_assert_equal_i(submodule_status, GIT_SUBMODULE_STATUS_IN_HEAD |
GIT_SUBMODULE_STATUS_IN_INDEX | GIT_SUBMODULE_STATUS_IN_INDEX |
GIT_SUBMODULE_STATUS_IN_CONFIG | GIT_SUBMODULE_STATUS_IN_CONFIG |
...@@ -114,7 +114,7 @@ void test_submodule_update__update_submodule(void) ...@@ -114,7 +114,7 @@ void test_submodule_update__update_submodule(void)
cl_git_pass(git_submodule_update(sm, 0, &update_options)); cl_git_pass(git_submodule_update(sm, 0, &update_options));
/* verify state */ /* 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 | cl_assert_equal_i(submodule_status, GIT_SUBMODULE_STATUS_IN_HEAD |
GIT_SUBMODULE_STATUS_IN_INDEX | GIT_SUBMODULE_STATUS_IN_INDEX |
GIT_SUBMODULE_STATUS_IN_CONFIG | GIT_SUBMODULE_STATUS_IN_CONFIG |
...@@ -142,7 +142,7 @@ void test_submodule_update__update_and_init_submodule(void) ...@@ -142,7 +142,7 @@ void test_submodule_update__update_and_init_submodule(void)
/* get the submodule */ /* get the submodule */
cl_git_pass(git_submodule_lookup(&sm, g_repo, "testrepo")); 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 | cl_assert_equal_i(submodule_status, GIT_SUBMODULE_STATUS_IN_HEAD |
GIT_SUBMODULE_STATUS_IN_INDEX | GIT_SUBMODULE_STATUS_IN_INDEX |
GIT_SUBMODULE_STATUS_IN_CONFIG | GIT_SUBMODULE_STATUS_IN_CONFIG |
...@@ -177,7 +177,7 @@ void test_submodule_update__update_already_checked_out_submodule(void) ...@@ -177,7 +177,7 @@ void test_submodule_update__update_already_checked_out_submodule(void)
/* Initialize and update the sub repository */ /* Initialize and update the sub repository */
cl_git_pass(git_submodule_lookup(&sm, g_repo, "testrepo")); 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 | cl_assert_equal_i(submodule_status, GIT_SUBMODULE_STATUS_IN_HEAD |
GIT_SUBMODULE_STATUS_IN_INDEX | GIT_SUBMODULE_STATUS_IN_INDEX |
GIT_SUBMODULE_STATUS_IN_CONFIG | GIT_SUBMODULE_STATUS_IN_CONFIG |
...@@ -203,7 +203,7 @@ void test_submodule_update__update_already_checked_out_submodule(void) ...@@ -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. * 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); git_submodule_free(sm);
cl_git_pass(git_submodule_lookup(&sm, g_repo, "testrepo")); cl_git_pass(git_submodule_lookup(&sm, g_repo, "testrepo"));
...@@ -255,7 +255,7 @@ void test_submodule_update__update_blocks_on_dirty_wd(void) ...@@ -255,7 +255,7 @@ void test_submodule_update__update_blocks_on_dirty_wd(void)
/* Initialize and update the sub repository */ /* Initialize and update the sub repository */
cl_git_pass(git_submodule_lookup(&sm, g_repo, "testrepo")); 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 | cl_assert_equal_i(submodule_status, GIT_SUBMODULE_STATUS_IN_HEAD |
GIT_SUBMODULE_STATUS_IN_INDEX | GIT_SUBMODULE_STATUS_IN_INDEX |
GIT_SUBMODULE_STATUS_IN_CONFIG | GIT_SUBMODULE_STATUS_IN_CONFIG |
...@@ -281,7 +281,7 @@ void test_submodule_update__update_blocks_on_dirty_wd(void) ...@@ -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. * 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); git_submodule_free(sm);
cl_git_pass(git_submodule_lookup(&sm, g_repo, "testrepo")); cl_git_pass(git_submodule_lookup(&sm, g_repo, "testrepo"));
...@@ -332,7 +332,7 @@ void test_submodule_update__can_force_update(void) ...@@ -332,7 +332,7 @@ void test_submodule_update__can_force_update(void)
/* Initialize and update the sub repository */ /* Initialize and update the sub repository */
cl_git_pass(git_submodule_lookup(&sm, g_repo, "testrepo")); 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 | cl_assert_equal_i(submodule_status, GIT_SUBMODULE_STATUS_IN_HEAD |
GIT_SUBMODULE_STATUS_IN_INDEX | GIT_SUBMODULE_STATUS_IN_INDEX |
GIT_SUBMODULE_STATUS_IN_CONFIG | GIT_SUBMODULE_STATUS_IN_CONFIG |
...@@ -357,7 +357,7 @@ void test_submodule_update__can_force_update(void) ...@@ -357,7 +357,7 @@ void test_submodule_update__can_force_update(void)
* Verify state after checkout of parent repository. The submodule ID in the * Verify state after checkout of parent repository. The submodule ID in the
* HEAD commit and index should be updated, but not the workdir. * 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); git_submodule_free(sm);
cl_git_pass(git_submodule_lookup(&sm, g_repo, "testrepo")); cl_git_pass(git_submodule_lookup(&sm, g_repo, "testrepo"));
......
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