mirror of
https://git.proxmox.com/git/libgit2
synced 2025-05-02 08:40:20 +00:00
Rename FALLBACK to UNSPECIFIED
Fallback describes the mechanism, while unspecified explains what the user is thinking.
This commit is contained in:
parent
daacf96d10
commit
c2418f4613
@ -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
|
||||
|
@ -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)
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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 */
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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);
|
||||
|
@ -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;
|
||||
|
@ -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 */
|
||||
|
@ -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)
|
||||
|
@ -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;
|
||||
}
|
||||
|
@ -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"));
|
||||
|
Loading…
Reference in New Issue
Block a user