]>
git.proxmox.com Git - libgit2.git/blob - src/refspec.h
2 * Copyright (C) 2009-2012 the libgit2 contributors
4 * This file is part of libgit2, distributed under the GNU GPL v2 with
5 * a Linking Exception. For full terms see the included COPYING file.
7 #ifndef INCLUDE_refspec_h__
8 #define INCLUDE_refspec_h__
10 #include "git2/refspec.h"
14 struct git_refspec
*next
;
17 unsigned int force
:1,
22 #define GIT_REFSPEC_TAGS "refs/tags/*:refs/tags/*"
24 int git_refspec_parse(struct git_refspec
*refspec
, const char *str
);
25 int git_refspec__parse(
26 struct git_refspec
*refspec
,
30 void git_refspec__free(git_refspec
*refspec
);
33 * Transform a reference to its target following the refspec's rules,
34 * and writes the results into a git_buf.
36 * @param out where to store the target name
37 * @param spec the refspec
38 * @param name the name of the reference to transform
39 * @return 0 or error if buffer allocation fails
41 int git_refspec_transform_r(git_buf
*out
, const git_refspec
*spec
, const char *name
);
44 * Transform a reference from its target following the refspec's rules,
45 * and writes the results into a git_buf.
47 * @param out where to store the source name
48 * @param spec the refspec
49 * @param name the name of the reference to transform
50 * @return 0 or error if buffer allocation fails
52 int git_refspec_transform_l(git_buf
*out
, const git_refspec
*spec
, const char *name
);
54 int git_refspec__serialize(git_buf
*out
, const git_refspec
*refspec
);
57 * Determines if a refspec is a wildcard refspec.
59 * @param spec the refspec
60 * @return 1 if the refspec is a wildcard, 0 otherwise
62 int git_refspec_is_wildcard(const git_refspec
*spec
);