当前位置: 首页>>代码示例>>C++>>正文


C++ GIT_UNUSED函数代码示例

本文整理汇总了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
}
开发者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


注:本文中的GIT_UNUSED函数示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。