]>
Commit | Line | Data |
---|---|---|
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 | ||
10 | #include "git2/refspec.h" | |
97769280 | 11 | #include "buffer.h" |
af613ecd | 12 | #include "vector.h" |
9c82357b CMN |
13 | |
14 | struct git_refspec { | |
1be680c4 | 15 | char *string; |
9c82357b CMN |
16 | char *src; |
17 | char *dst; | |
dc9e960f | 18 | unsigned int force :1, |
4330ab26 | 19 | push : 1, |
dc9e960f CMN |
20 | pattern :1, |
21 | matching :1; | |
9c82357b CMN |
22 | }; |
23 | ||
3230a44f CMN |
24 | #define GIT_REFSPEC_TAGS "refs/tags/*:refs/tags/*" |
25 | ||
0adfa20a | 26 | int git_refspec__parse( |
27 | struct git_refspec *refspec, | |
28 | const char *str, | |
29 | bool is_fetch); | |
9c82357b | 30 | |
3665ba8e CMN |
31 | void git_refspec__free(git_refspec *refspec); |
32 | ||
fb39b3a5 | 33 | int git_refspec__serialize(git_buf *out, const git_refspec *refspec); |
34 | ||
b0f6e45d ET |
35 | /** |
36 | * Determines if a refspec is a wildcard refspec. | |
37 | * | |
38 | * @param spec the refspec | |
39 | * @return 1 if the refspec is a wildcard, 0 otherwise | |
40 | */ | |
41 | int git_refspec_is_wildcard(const git_refspec *spec); | |
42 | ||
af613ecd CMN |
43 | /** |
44 | * DWIM `spec` with `refs` existing on the remote, append the dwim'ed | |
45 | * result in `out`. | |
46 | */ | |
47 | int git_refspec__dwim_one(git_vector *out, git_refspec *spec, git_vector *refs); | |
48 | ||
9c82357b | 49 | #endif |