| 1 |
|
| MODULE = Git::Raw PACKAGE = Git::Raw::RefSpec |
| 2 |
|
| |
| 3 |
|
| RefSpec |
| 4 |
|
| parse(class, input, is_fetch) |
| 5 |
|
| SV *class |
| 6 |
|
| SV *input |
| 7 |
|
| SV *is_fetch |
| 8 |
|
| |
| 9 |
|
| PREINIT: |
| 10 |
|
| int rc; |
| 11 |
1 |
| git_refspec *s = NULL; |
| 12 |
1 |
| RefSpec spec = NULL; |
| 13 |
|
| |
| 14 |
|
| CODE: |
| 15 |
1 |
| rc = git_refspec_parse(&s, git_ensure_pv(input, "input"), |
| 16 |
|
| git_ensure_iv(is_fetch, "is_fetch")); |
| 17 |
1 |
| git_check_error(rc); |
| 18 |
|
| |
| 19 |
1 |
| Newxz(spec, 1, git_raw_refspec); |
| 20 |
1 |
| spec -> refspec = s; |
| 21 |
1 |
| spec -> owned = 1; |
| 22 |
|
| |
| 23 |
1 |
| RETVAL = spec; |
| 24 |
|
| |
| 25 |
|
| OUTPUT: RETVAL |
| 26 |
|
| |
| 27 |
|
| SV * |
| 28 |
|
| dst(self) |
| 29 |
|
| RefSpec self |
| 30 |
|
| |
| 31 |
|
| CODE: |
| 32 |
3 |
| RETVAL = newSVpv(git_refspec_dst(self -> refspec), 0); |
| 33 |
|
| |
| 34 |
|
| OUTPUT: RETVAL |
| 35 |
|
| |
| 36 |
|
| SV * |
| 37 |
|
| dst_matches(self, ref) |
| 38 |
|
| RefSpec self |
| 39 |
|
| SV *ref |
| 40 |
|
| |
| 41 |
|
| PREINIT: |
| 42 |
|
| const char *ref_name; |
| 43 |
|
| |
| 44 |
|
| CODE: |
| 45 |
2 |
| ref_name = git_ensure_pv(ref, "name"); |
| 46 |
|
| |
| 47 |
2 |
| RETVAL = newSViv(git_refspec_dst_matches(self -> refspec, ref_name)); |
| 48 |
|
| |
| 49 |
|
| OUTPUT: RETVAL |
| 50 |
|
| |
| 51 |
|
| SV * |
| 52 |
|
| src(self) |
| 53 |
|
| RefSpec self |
| 54 |
|
| |
| 55 |
|
| CODE: |
| 56 |
3 |
| RETVAL = newSVpv(git_refspec_src(self -> refspec), 0); |
| 57 |
|
| |
| 58 |
|
| OUTPUT: RETVAL |
| 59 |
|
| |
| 60 |
|
| SV * |
| 61 |
|
| src_matches(self, ref) |
| 62 |
|
| RefSpec self |
| 63 |
|
| SV *ref |
| 64 |
|
| |
| 65 |
|
| PREINIT: |
| 66 |
|
| const char *ref_name; |
| 67 |
|
| |
| 68 |
|
| CODE: |
| 69 |
1 |
| ref_name = git_ensure_pv(ref, "name"); |
| 70 |
|
| |
| 71 |
1 |
| RETVAL = newSViv(git_refspec_src_matches(self -> refspec, ref_name)); |
| 72 |
|
| |
| 73 |
|
| OUTPUT: RETVAL |
| 74 |
|
| |
| 75 |
|
| SV * |
| 76 |
|
| string(self) |
| 77 |
|
| RefSpec self |
| 78 |
|
| |
| 79 |
|
| CODE: |
| 80 |
5 |
| RETVAL = newSVpv(git_refspec_string(self -> refspec), 0); |
| 81 |
|
| |
| 82 |
|
| OUTPUT: RETVAL |
| 83 |
|
| |
| 84 |
|
| SV * |
| 85 |
|
| direction(self) |
| 86 |
|
| RefSpec self |
| 87 |
|
| |
| 88 |
|
| PREINIT: |
| 89 |
|
| git_direction dir; |
| 90 |
|
| |
| 91 |
|
| CODE: |
| 92 |
3 |
| dir = git_refspec_direction(self -> refspec); |
| 93 |
3 |
▶ | if (dir == GIT_DIRECTION_FETCH) |
Branch: 1 branch
| Branch | True | False | Total |
| if (dir == GIT_DIRECTION_FETCH) |
3 |
0 |
3 |
|
| 94 |
3 |
| RETVAL = newSVpv("fetch", 0); |
| 95 |
0 |
▶ | else if (dir == GIT_DIRECTION_PUSH) |
Branch: 1 branch
| Branch | True | False | Total |
| else if (dir == GIT_DIRECTION_PUSH) |
0 |
0 |
0 |
|
| 96 |
0 |
| RETVAL = newSVpv("push", 0); |
| 97 |
|
| else |
| 98 |
0 |
| RETVAL = &PL_sv_undef; |
| 99 |
|
| |
| 100 |
|
| OUTPUT: RETVAL |
| 101 |
|
| |
| 102 |
|
| SV * |
| 103 |
|
| transform(self, ref) |
| 104 |
|
| RefSpec self |
| 105 |
|
| SV *ref |
| 106 |
|
| |
| 107 |
|
| PREINIT: |
| 108 |
|
| int rc; |
| 109 |
|
| |
| 110 |
|
| const char *ref_name; |
| 111 |
1 |
| git_buf buf = GIT_BUF_INIT_CONST(NULL, 0); |
| 112 |
|
| |
| 113 |
|
| CODE: |
| 114 |
1 |
| RETVAL = &PL_sv_undef; |
| 115 |
|
| |
| 116 |
1 |
| ref_name = git_ensure_pv(ref, "name"); |
| 117 |
|
| |
| 118 |
1 |
| rc = git_refspec_transform(&buf, self -> refspec, ref_name); |
| 119 |
1 |
▶ | if (rc == GIT_OK) |
Branch: 1 branch
| Branch | True | False | Total |
| if (rc == GIT_OK) |
1 |
0 |
1 |
|
| 120 |
1 |
| RETVAL = newSVpv(buf.ptr, buf.size); |
| 121 |
|
| |
| 122 |
1 |
| git_buf_dispose(&buf); |
| 123 |
1 |
| git_check_error(rc); |
| 124 |
|
| |
| 125 |
|
| OUTPUT: RETVAL |
| 126 |
|
| |
| 127 |
|
| SV * |
| 128 |
|
| rtransform(self, ref) |
| 129 |
|
| RefSpec self |
| 130 |
|
| SV *ref |
| 131 |
|
| |
| 132 |
|
| PREINIT: |
| 133 |
|
| int rc; |
| 134 |
|
| |
| 135 |
|
| const char *ref_name; |
| 136 |
1 |
| git_buf buf = GIT_BUF_INIT_CONST(NULL, 0); |
| 137 |
|
| |
| 138 |
|
| CODE: |
| 139 |
1 |
| RETVAL = &PL_sv_undef; |
| 140 |
|
| |
| 141 |
1 |
| ref_name = git_ensure_pv(ref, "name"); |
| 142 |
|
| |
| 143 |
1 |
| rc = git_refspec_rtransform(&buf, self -> refspec, ref_name); |
| 144 |
1 |
▶ | if (rc == GIT_OK) |
Branch: 1 branch
| Branch | True | False | Total |
| if (rc == GIT_OK) |
1 |
0 |
1 |
|
| 145 |
1 |
| RETVAL = newSVpv(buf.ptr, buf.size); |
| 146 |
|
| |
| 147 |
1 |
| git_buf_dispose(&buf); |
| 148 |
1 |
| git_check_error(rc); |
| 149 |
|
| |
| 150 |
|
| OUTPUT: RETVAL |
| 151 |
|
| |
| 152 |
|
| SV * |
| 153 |
|
| is_force(self) |
| 154 |
|
| RefSpec self |
| 155 |
|
| |
| 156 |
|
| CODE: |
| 157 |
2 |
| RETVAL = newSViv(git_refspec_force(self -> refspec)); |
| 158 |
|
| |
| 159 |
|
| OUTPUT: RETVAL |
| 160 |
|
| |
| 161 |
|
| void |
| 162 |
|
| DESTROY(self) |
| 163 |
|
| SV *self |
| 164 |
|
| |
| 165 |
|
| PREINIT: |
| 166 |
|
| RefSpec spec; |
| 167 |
|
| |
| 168 |
|
| CODE: |
| 169 |
4 |
| spec = GIT_SV_TO_PTR(RefSpec, self); |
| 170 |
|
| |
| 171 |
4 |
▶ | if (spec -> owned) |
Branch: 1 branch
| Branch | True | False | Total |
| if (spec -> owned) |
1 |
3 |
4 |
|
| 172 |
1 |
| git_refspec_free(spec -> refspec); |
| 173 |
|
| else |
| 174 |
3 |
| SvREFCNT_dec(GIT_SV_TO_MAGIC(self)); |
| 175 |
|
| |
| 176 |
4 |
| Safefree(spec); |
| 177 |
|
| |