Exemplo n.º 1
0
int git_refspec_rtransform(git_buf *out, const git_refspec *spec, const char *name)
{
        git_buf_sanitize(out);

	if (!spec->pattern)
		return git_buf_puts(out, spec->src);

	return refspec_transform(out, spec->dst, spec->src, name);
}
Exemplo n.º 2
0
int git_refspec_rtransform(git_buf *out, const git_refspec *spec, const char *name)
{
	assert(out && spec && name);
	git_buf_sanitize(out);

	if (!git_refspec_dst_matches(spec, name)) {
		giterr_set(GITERR_INVALID, "ref '%s' doesn't match the destination", name);
		return -1;
	}

	if (!spec->pattern)
		return git_buf_puts(out, spec->src);

	return refspec_transform(out, spec->dst, spec->src, name);
}
Exemplo n.º 3
0
int git_refspec_transform(git_buf *out, const git_refspec *spec, const char *name)
{
	assert(out && spec && name);
	git_buf_sanitize(out);

	if (!git_refspec_src_matches(spec, name)) {
		git_error_set(GIT_ERROR_INVALID, "ref '%s' doesn't match the source", name);
		return -1;
	}

	if (!spec->pattern)
		return git_buf_puts(out, spec->dst ? spec->dst : "");

	return refspec_transform(out, spec->src, spec->dst, name);
}
Exemplo n.º 4
0
int git_refspec_rtransform(git_buf *out, const git_refspec *spec, const char *name)
{
	return refspec_transform(out, spec->dst, spec->src, name);
}