本文整理匯總了C++中GIT_UNUSED函數的典型用法代碼示例。如果您正苦於以下問題:C++ GIT_UNUSED函數的具體用法?C++ GIT_UNUSED怎麽用?C++ GIT_UNUSED使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了GIT_UNUSED函數的15個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的C++代碼示例。
示例1: git_transport_ssh_with_paths
int git_transport_ssh_with_paths(git_transport **out, git_remote *owner, void *payload)
{
#ifdef GIT_SSH
git_strarray *paths = (git_strarray *) payload;
git_transport *transport;
transport_smart *smart;
ssh_subtransport *t;
int error;
git_smart_subtransport_definition ssh_definition = {
git_smart_subtransport_ssh,
0, /* no RPC */
NULL,
};
if (paths->count != 2) {
giterr_set(GITERR_SSH, "invalid ssh paths, must be two strings");
return GIT_EINVALIDSPEC;
}
if ((error = git_transport_smart(&transport, owner, &ssh_definition)) < 0)
return error;
smart = (transport_smart *) transport;
t = (ssh_subtransport *) smart->wrapped;
t->cmd_uploadpack = git__strdup(paths->strings[0]);
GITERR_CHECK_ALLOC(t->cmd_uploadpack);
t->cmd_receivepack = git__strdup(paths->strings[1]);
GITERR_CHECK_ALLOC(t->cmd_receivepack);
*out = transport;
return 0;
#else
GIT_UNUSED(owner);
GIT_UNUSED(payload);
assert(out);
*out = NULL;
giterr_set(GITERR_INVALID, "Cannot create SSH transport. Library was built without SSH support");
return -1;
#endif
}
示例2: GIT_INLINE
GIT_INLINE(int) attr_cache_lock(git_attr_cache *cache)
{
GIT_UNUSED(cache); /* avoid warning if threading is off */
if (git_mutex_lock(&cache->lock) < 0) {
giterr_set(GITERR_OS, "Unable to get attr cache lock");
return -1;
}
return 0;
}
示例3: cred_cb
static int cred_cb(git_cred **cred, const char *url, const char *user_from_url,
unsigned int allowed_types, void *payload)
{
const char *remote_user = cl_getenv("GITTEST_REMOTE_USER");
const char *pubkey = cl_getenv("GITTEST_REMOTE_SSH_PUBKEY");
const char *privkey = cl_getenv("GITTEST_REMOTE_SSH_KEY");
const char *passphrase = cl_getenv("GITTEST_REMOTE_SSH_PASSPHRASE");
GIT_UNUSED(url); GIT_UNUSED(user_from_url); GIT_UNUSED(payload);
if (allowed_types & GIT_CREDTYPE_USERNAME)
return git_cred_username_new(cred, remote_user);
if (allowed_types & GIT_CREDTYPE_SSH_KEY)
return git_cred_ssh_key_new(cred, remote_user, pubkey, privkey, passphrase);
giterr_set(GITERR_NET, "unexpected cred type");
return -1;
}
示例4: interrupt_cb
static int interrupt_cb(const char *reference_name, void *payload)
{
int *count = (int *)payload;
GIT_UNUSED(reference_name);
(*count)++;
return (*count == 11);
}
示例5: _ssh_close
static int _ssh_close(git_smart_subtransport *subtransport)
{
ssh_subtransport *t = (ssh_subtransport *) subtransport;
assert(!t->current_stream);
GIT_UNUSED(t);
return 0;
}
示例6: checkout_cancel_cb
static int checkout_cancel_cb(
git_checkout_notify_t why,
const char *path,
const git_diff_file *b,
const git_diff_file *t,
const git_diff_file *w,
void *payload)
{
struct checkout_cancel_at *ca = payload;
GIT_UNUSED(why); GIT_UNUSED(b); GIT_UNUSED(t); GIT_UNUSED(w);
ca->count++;
if (!strcmp(path, ca->filename))
return ca->error;
return 0;
}
示例7: tag_list_cb
static int tag_list_cb(const char *tag_name, git_oid *oid, void *data)
{
tag_filter_data *filter = (tag_filter_data *)data;
GIT_UNUSED(oid);
if (!*filter->pattern || p_fnmatch(filter->pattern, tag_name + GIT_REFS_TAGS_DIR_LEN, 0) == 0)
return git_vector_insert(filter->taglist, git__strdup(tag_name + GIT_REFS_TAGS_DIR_LEN));
return 0;
}
示例8: count_me
static int count_me(const git_config_entry *entry, void *payload)
{
int *n = (int *) payload;
GIT_UNUSED(entry);
(*n)++;
return 0;
}
示例9: rebase_init_merge
static int rebase_init_merge(
git_rebase *rebase,
git_repository *repo,
const git_annotated_commit *branch,
const git_annotated_commit *upstream,
const git_annotated_commit *onto)
{
git_reference *head_ref = NULL;
git_commit *onto_commit = NULL;
git_buf reflog = GIT_BUF_INIT;
git_buf state_path = GIT_BUF_INIT;
int error;
GIT_UNUSED(upstream);
if ((error = git_buf_joinpath(&state_path, repo->path_repository, REBASE_MERGE_DIR)) < 0)
goto done;
rebase->state_path = git_buf_detach(&state_path);
GITERR_CHECK_ALLOC(rebase->state_path);
if (branch->ref_name) {
rebase->orig_head_name = git__strdup(branch->ref_name);
GITERR_CHECK_ALLOC(rebase->orig_head_name);
} else {
rebase->head_detached = 1;
}
rebase->onto_name = git__strdup(rebase_onto_name(onto));
GITERR_CHECK_ALLOC(rebase->onto_name);
rebase->quiet = rebase->options.quiet;
git_oid_cpy(&rebase->orig_head_id, git_annotated_commit_id(branch));
git_oid_cpy(&rebase->onto_id, git_annotated_commit_id(onto));
if ((error = rebase_setupfiles(rebase)) < 0 ||
(error = git_buf_printf(&reflog,
"rebase: checkout %s", rebase_onto_name(onto))) < 0 ||
(error = git_commit_lookup(
&onto_commit, repo, git_annotated_commit_id(onto))) < 0 ||
(error = git_checkout_tree(repo,
(git_object *)onto_commit, &rebase->options.checkout_options)) < 0 ||
(error = git_reference_create(&head_ref, repo, GIT_HEAD_FILE,
git_annotated_commit_id(onto), 1, reflog.ptr)) < 0)
goto done;
done:
git_reference_free(head_ref);
git_commit_free(onto_commit);
git_buf_free(&reflog);
git_buf_free(&state_path);
return error;
}
示例10: default_remote_create
static int default_remote_create(
git_remote **out,
git_repository *repo,
const char *name,
const char *url,
void *payload)
{
GIT_UNUSED(payload);
return git_remote_create(out, repo, name, url);
}
示例11: p_mkdir
int p_mkdir(const char *path, mode_t mode)
{
git_win32_path buf;
GIT_UNUSED(mode);
if (utf8_to_16_with_errno(buf, path) < 0)
return -1;
return _wmkdir(buf);
}
示例12: cb_status__single
int cb_status__single(const char *p, unsigned int s, void *payload)
{
status_entry_single *data = (status_entry_single *)payload;
GIT_UNUSED(p);
data->count++;
data->status = s;
return 0;
}
示例13: checkout_conflict_count_cb
static int checkout_conflict_count_cb(
git_checkout_notify_t why,
const char *path,
const git_diff_file *b,
const git_diff_file *t,
const git_diff_file *w,
void *payload)
{
size_t *n = payload;
GIT_UNUSED(why);
GIT_UNUSED(path);
GIT_UNUSED(b);
GIT_UNUSED(t);
GIT_UNUSED(w);
(*n)++;
return 0;
}
示例14: p_mkdir
int p_mkdir(const char *path, mode_t mode)
{
git_win32_path buf;
GIT_UNUSED(mode);
if (git_win32_path_from_utf8(buf, path) < 0)
return -1;
return _wmkdir(buf);
}
示例15: checkout_notify_cb
static int checkout_notify_cb(
git_checkout_notify_t why,
const char *path,
const git_diff_file *baseline,
const git_diff_file *target,
const git_diff_file *workdir,
void *payload)
{
struct update_submodule_cb_payload *update_payload = payload;
GIT_UNUSED(why);
GIT_UNUSED(path);
GIT_UNUSED(baseline);
GIT_UNUSED(target);
GIT_UNUSED(workdir);
update_payload->checkout_notify_called = 1;
return 0;
}