本文整理汇总了C++中GIT_UNUSED函数的典型用法代码示例。如果您正苦于以下问题:C++ GIT_UNUSED函数的具体用法?C++ GIT_UNUSED怎么用?C++ GIT_UNUSED使用的例子?那么恭喜您, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了GIT_UNUSED函数的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的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
}
开发者ID:CODECOMMUNITY,项目名称:libgit2,代码行数:43,代码来源:ssh.c
示例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;
}
开发者ID:1336,项目名称:libgit2,代码行数:10,代码来源:attrcache.c
示例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;
}
开发者ID:DavidMolinari,项目名称:sonic-pi,代码行数:19,代码来源:clone.c
示例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);
}
开发者ID:0CV0,项目名称:libgit2,代码行数:10,代码来源:foreachglob.c
示例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;
}
开发者ID:KindDragon,项目名称:libgit2,代码行数:10,代码来源:ssh.c
示例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;
}
开发者ID:Kat7984,项目名称:libgit2,代码行数:19,代码来源:tree.c
示例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;
}
开发者ID:2020sebastian,项目名称:libgit2,代码行数:10,代码来源:tag.c
示例8: count_me
static int count_me(const git_config_entry *entry, void *payload)
{
int *n = (int *) payload;
GIT_UNUSED(entry);
(*n)++;
return 0;
}
开发者ID:1336,项目名称:libgit2,代码行数:10,代码来源:snapshot.c
示例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;
}
开发者ID:Corillian,项目名称:libgit2,代码行数:55,代码来源:rebase.c
示例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);
}
开发者ID:ethomson,项目名称:libgit2,代码行数:11,代码来源:clone.c
示例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);
}
开发者ID:DaneTheory,项目名称:libgit2,代码行数:11,代码来源:posix_w32.c
示例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;
}
开发者ID:2020sebastian,项目名称:libgit2,代码行数:11,代码来源:status_helpers.c
示例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;
}
开发者ID:Kat7984,项目名称:libgit2,代码行数:20,代码来源:tree.c
示例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);
}
开发者ID:1336,项目名称:libgit2,代码行数:11,代码来源:posix_w32.c
示例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;
}
开发者ID:CODECOMMUNITY,项目名称:libgit2,代码行数:20,代码来源:update.c
示例16: aborting_progress_cb
int aborting_progress_cb(
git_stash_apply_progress_t progress,
void *payload)
{
GIT_UNUSED(payload);
if (progress == GIT_STASH_APPLY_PROGRESS_ANALYZE_MODIFIED)
return -44;
return 0;
}
开发者ID:Angeldude,项目名称:sonic-pi,代码行数:11,代码来源:apply.c
示例17: cb_cred_access_token
// callback: tries the access_token passed in through the payload ONCE
// and returns GIT_EAUTH if called for a second time
int cb_cred_access_token(git_cred **out, const char *url, const char *username_from_url,
unsigned int allowed_types, void *payload) {
GIT_UNUSED(url);
GIT_UNUSED(username_from_url);
if (allowed_types & GIT_CREDTYPE_USERPASS_PLAINTEXT) {
struct credentials_s *credentials = payload;
if (credentials->count > 0) {
git_error_set_str(GIT_ERROR_CALLBACK, "Invalid token");
return GIT_EAUTH;
} else {
credentials->count++;
return git_cred_userpass_plaintext_new(out, "x-access-token", credentials->access_token);
}
}
return GIT_PASSTHROUGH;
}
开发者ID:backhub,项目名称:gitfetch,代码行数:22,代码来源:credentials.c
示例18: git_tls_stream_new
int git_tls_stream_new(git_stream **out, const char *host, const char *port)
{
if (tls_ctor)
return tls_ctor(out, host, port);
#ifdef GIT_SECURE_TRANSPORT
return git_stransport_stream_new(out, host, port);
#elif defined(GIT_OPENSSL)
return git_openssl_stream_new(out, host, port);
#elif defined(GIT_MBEDTLS)
return git_mbedtls_stream_new(out, host, port);
#else
GIT_UNUSED(out);
GIT_UNUSED(host);
GIT_UNUSED(port);
giterr_set(GITERR_SSL, "there is no TLS stream available");
return -1;
#endif
}
开发者ID:csware,项目名称:libgit2,代码行数:21,代码来源:tls.c
示例19: notify_cb__basic
static int notify_cb__basic(
const git_diff *diff_so_far,
const git_diff_delta *delta_to_add,
const char *matched_pathspec,
void *payload)
{
basic_payload *exp = (basic_payload *)payload;
basic_payload *e;
GIT_UNUSED(diff_so_far);
GIT_UNUSED(matched_pathspec);
for (e = exp; e->path; e++) {
if (strcmp(e->path, delta_to_add->new_file.path) == 0) {
cl_assert_equal_i(e->t, delta_to_add->status);
return 0;
}
}
cl_assert(0);
return GIT_ENOTFOUND;
}
开发者ID:Angeldude,项目名称:sonic-pi,代码行数:21,代码来源:racediffiter.c
示例20: winhttp_uploadpack
static int winhttp_uploadpack(
winhttp_subtransport *t,
winhttp_stream *s)
{
GIT_UNUSED(t);
s->service = upload_pack_service;
s->service_url = upload_pack_service_url;
s->verb = post_verb;
return 0;
}
开发者ID:DavidMolinari,项目名称:sonic-pi,代码行数:12,代码来源:winhttp.c
注:本文中的GIT_UNUSED函数示例由纯净天空整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论