]>
git.proxmox.com Git - libgit2.git/blob - src/refspec.h
2 * Copyright (C) the libgit2 contributors. All rights reserved.
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"
17 unsigned int force
:1,
24 #define GIT_REFSPEC_TAGS "refs/tags/*:refs/tags/*"
26 int git_refspec_parse(struct git_refspec
*refspec
, const char *str
);
27 int git_refspec__parse(
28 struct git_refspec
*refspec
,
32 void git_refspec__free(git_refspec
*refspec
);
35 * Transform a reference to its target following the refspec's rules,
36 * and writes the results into a git_buf.
38 * @param out where to store the target name
39 * @param spec the refspec
40 * @param name the name of the reference to transform
41 * @return 0 or error if buffer allocation fails
43 int git_refspec_transform_r(git_buf
*out
, const git_refspec
*spec
, const char *name
);
46 * Transform a reference from its target following the refspec's rules,
47 * and writes the results into a git_buf.
49 * @param out where to store the source name
50 * @param spec the refspec
51 * @param name the name of the reference to transform
52 * @return 0 or error if buffer allocation fails
54 int git_refspec_transform_l(git_buf
*out
, const git_refspec
*spec
, const char *name
);
56 int git_refspec__serialize(git_buf
*out
, const git_refspec
*refspec
);
59 * Determines if a refspec is a wildcard refspec.
61 * @param spec the refspec
62 * @return 1 if the refspec is a wildcard, 0 otherwise
64 int git_refspec_is_wildcard(const git_refspec
*spec
);