]> git.proxmox.com Git - libgit2.git/blame - src/refspec.h
Add dependency on ca-certificates and libpcre3-dev
[libgit2.git] / src / refspec.h
CommitLineData
bb742ede 1/*
359fc2d2 2 * Copyright (C) the libgit2 contributors. All rights reserved.
bb742ede
VM
3 *
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.
6 */
9c82357b
CMN
7#ifndef INCLUDE_refspec_h__
8#define INCLUDE_refspec_h__
9
eae0bfdc
PP
10#include "common.h"
11
9c82357b 12#include "git2/refspec.h"
97769280 13#include "buffer.h"
af613ecd 14#include "vector.h"
9c82357b
CMN
15
16struct git_refspec {
1be680c4 17 char *string;
9c82357b
CMN
18 char *src;
19 char *dst;
dc9e960f 20 unsigned int force :1,
4330ab26 21 push : 1,
dc9e960f
CMN
22 pattern :1,
23 matching :1;
9c82357b
CMN
24};
25
3230a44f
CMN
26#define GIT_REFSPEC_TAGS "refs/tags/*:refs/tags/*"
27
0adfa20a 28int git_refspec__parse(
29 struct git_refspec *refspec,
30 const char *str,
31 bool is_fetch);
9c82357b 32
ac3d33df 33void git_refspec__dispose(git_refspec *refspec);
3665ba8e 34
fb39b3a5 35int git_refspec__serialize(git_buf *out, const git_refspec *refspec);
36
b0f6e45d
ET
37/**
38 * Determines if a refspec is a wildcard refspec.
39 *
40 * @param spec the refspec
41 * @return 1 if the refspec is a wildcard, 0 otherwise
42 */
43int git_refspec_is_wildcard(const git_refspec *spec);
44
af613ecd
CMN
45/**
46 * DWIM `spec` with `refs` existing on the remote, append the dwim'ed
47 * result in `out`.
48 */
49int git_refspec__dwim_one(git_vector *out, git_refspec *spec, git_vector *refs);
50
9c82357b 51#endif