| line |
stmt |
bran |
cond |
sub |
pod |
time |
code |
|
1
|
|
|
|
|
|
|
MODULE = Git::Raw PACKAGE = Git::Raw::Filter::List |
|
2
|
|
|
|
|
|
|
|
|
3
|
|
|
|
|
|
|
SV * |
|
4
|
|
|
|
|
|
|
load(class, repo, path, mode) |
|
5
|
|
|
|
|
|
|
const char *class |
|
6
|
|
|
|
|
|
|
SV *repo |
|
7
|
|
|
|
|
|
|
SV *path |
|
8
|
|
|
|
|
|
|
SV *mode |
|
9
|
|
|
|
|
|
|
|
|
10
|
|
|
|
|
|
|
PREINIT: |
|
11
|
|
|
|
|
|
|
int rc; |
|
12
|
|
|
|
|
|
|
|
|
13
|
|
|
|
|
|
|
Repository repo_ptr; |
|
14
|
4
|
|
|
|
|
|
Filter_List list = NULL; |
|
15
|
4
|
|
|
|
|
|
git_filter_mode_t m = GIT_FILTER_TO_WORKTREE; |
|
16
|
|
|
|
|
|
|
|
|
17
|
|
|
|
|
|
|
CODE: |
|
18
|
4
|
|
|
|
|
|
repo_ptr = GIT_SV_TO_PTR(Repository, repo); |
|
19
|
|
|
|
|
|
|
|
|
20
|
4
|
100
|
|
|
|
|
if (SvPOK(mode)) { |
|
21
|
3
|
|
|
|
|
|
const char *mode_str = git_ensure_pv(mode, "mode"); |
|
22
|
|
|
|
|
|
|
|
|
23
|
3
|
100
|
|
|
|
|
if (strcmp(mode_str, "to_odb") == 0) |
|
24
|
1
|
|
|
|
|
|
m = GIT_FILTER_TO_ODB; |
|
25
|
2
|
100
|
|
|
|
|
else if (strcmp(mode_str, "to_worktree") == 0) |
|
26
|
1
|
|
|
|
|
|
m = GIT_FILTER_TO_WORKTREE; |
|
27
|
|
|
|
|
|
|
else |
|
28
|
1
|
|
|
|
|
|
croak_usage("Invalid value for 'mode', expected 'to_odb' or 'to_worktree'"); |
|
29
|
|
|
|
|
|
|
|
|
30
|
2
|
|
|
|
|
|
rc = git_filter_list_load(&list, |
|
31
|
|
|
|
|
|
|
repo_ptr -> repository, NULL, |
|
32
|
|
|
|
|
|
|
git_ensure_pv(path, "path"), |
|
33
|
|
|
|
|
|
|
m, |
|
34
|
|
|
|
|
|
|
GIT_FILTER_DEFAULT |
|
35
|
|
|
|
|
|
|
); |
|
36
|
2
|
|
|
|
|
|
git_check_error(rc); |
|
37
|
|
|
|
|
|
|
} else |
|
38
|
1
|
|
|
|
|
|
croak_usage("Invalid type for 'mode' value"); |
|
39
|
|
|
|
|
|
|
|
|
40
|
2
|
|
|
|
|
|
RETVAL = &PL_sv_undef; |
|
41
|
2
|
50
|
|
|
|
|
if (list != NULL) { |
|
42
|
2
|
|
|
|
|
|
GIT_NEW_OBJ_WITH_MAGIC( |
|
43
|
|
|
|
|
|
|
RETVAL, class, |
|
44
|
|
|
|
|
|
|
list, SvRV(repo) |
|
45
|
|
|
|
|
|
|
); |
|
46
|
|
|
|
|
|
|
} |
|
47
|
|
|
|
|
|
|
|
|
48
|
|
|
|
|
|
|
OUTPUT: RETVAL |
|
49
|
|
|
|
|
|
|
|
|
50
|
|
|
|
|
|
|
SV * |
|
51
|
|
|
|
|
|
|
apply_to_blob(self, blob) |
|
52
|
|
|
|
|
|
|
Filter_List self |
|
53
|
|
|
|
|
|
|
Blob blob |
|
54
|
|
|
|
|
|
|
|
|
55
|
|
|
|
|
|
|
PREINIT: |
|
56
|
|
|
|
|
|
|
int rc; |
|
57
|
|
|
|
|
|
|
|
|
58
|
2
|
|
|
|
|
|
git_buf buf = GIT_BUF_INIT_CONST(NULL, 0); |
|
59
|
|
|
|
|
|
|
|
|
60
|
|
|
|
|
|
|
CODE: |
|
61
|
2
|
|
|
|
|
|
rc = git_filter_list_apply_to_blob( |
|
62
|
|
|
|
|
|
|
&buf, self, blob |
|
63
|
|
|
|
|
|
|
); |
|
64
|
2
|
50
|
|
|
|
|
if (rc != GIT_OK) |
|
65
|
0
|
|
|
|
|
|
git_buf_dispose(&buf); |
|
66
|
|
|
|
|
|
|
|
|
67
|
2
|
|
|
|
|
|
git_check_error(rc); |
|
68
|
2
|
|
|
|
|
|
RETVAL = newSVpv(buf.ptr, buf.size); |
|
69
|
2
|
|
|
|
|
|
git_buf_dispose(&buf); |
|
70
|
|
|
|
|
|
|
|
|
71
|
|
|
|
|
|
|
OUTPUT: RETVAL |
|
72
|
|
|
|
|
|
|
|
|
73
|
|
|
|
|
|
|
SV * |
|
74
|
|
|
|
|
|
|
apply_to_data(self, data) |
|
75
|
|
|
|
|
|
|
Filter_List self |
|
76
|
|
|
|
|
|
|
SV *data |
|
77
|
|
|
|
|
|
|
|
|
78
|
|
|
|
|
|
|
PREINIT: |
|
79
|
|
|
|
|
|
|
int rc; |
|
80
|
|
|
|
|
|
|
|
|
81
|
|
|
|
|
|
|
const char *data_str; |
|
82
|
|
|
|
|
|
|
STRLEN len; |
|
83
|
|
|
|
|
|
|
|
|
84
|
2
|
|
|
|
|
|
git_buf in = GIT_BUF_INIT_CONST(NULL, 0); |
|
85
|
2
|
|
|
|
|
|
git_buf buf = GIT_BUF_INIT_CONST(NULL, 0); |
|
86
|
|
|
|
|
|
|
|
|
87
|
|
|
|
|
|
|
CODE: |
|
88
|
2
|
|
|
|
|
|
data_str = git_ensure_pv_with_len(data, "data", &len); |
|
89
|
|
|
|
|
|
|
|
|
90
|
2
|
|
|
|
|
|
rc = git_buf_set(&in, data_str, (size_t) len); |
|
91
|
2
|
|
|
|
|
|
git_check_error(rc); |
|
92
|
|
|
|
|
|
|
|
|
93
|
2
|
|
|
|
|
|
rc = git_filter_list_apply_to_data( |
|
94
|
|
|
|
|
|
|
&buf, self, &in |
|
95
|
|
|
|
|
|
|
); |
|
96
|
2
|
50
|
|
|
|
|
if (rc != GIT_OK) { |
|
97
|
0
|
|
|
|
|
|
git_buf_dispose(&in); |
|
98
|
0
|
|
|
|
|
|
git_buf_dispose(&buf); |
|
99
|
|
|
|
|
|
|
} |
|
100
|
|
|
|
|
|
|
|
|
101
|
2
|
|
|
|
|
|
git_check_error(rc); |
|
102
|
|
|
|
|
|
|
|
|
103
|
2
|
|
|
|
|
|
RETVAL = newSVpv(buf.ptr, buf.size); |
|
104
|
|
|
|
|
|
|
|
|
105
|
2
|
|
|
|
|
|
git_buf_dispose(&in); |
|
106
|
2
|
|
|
|
|
|
git_buf_dispose(&buf); |
|
107
|
|
|
|
|
|
|
|
|
108
|
|
|
|
|
|
|
OUTPUT: RETVAL |
|
109
|
|
|
|
|
|
|
|
|
110
|
|
|
|
|
|
|
SV * |
|
111
|
|
|
|
|
|
|
apply_to_file(self, path) |
|
112
|
|
|
|
|
|
|
SV *self |
|
113
|
|
|
|
|
|
|
const char *path |
|
114
|
|
|
|
|
|
|
|
|
115
|
|
|
|
|
|
|
PREINIT: |
|
116
|
|
|
|
|
|
|
int rc; |
|
117
|
|
|
|
|
|
|
|
|
118
|
|
|
|
|
|
|
SV *repo; |
|
119
|
|
|
|
|
|
|
Repository repo_ptr; |
|
120
|
|
|
|
|
|
|
Filter_List list; |
|
121
|
|
|
|
|
|
|
|
|
122
|
2
|
|
|
|
|
|
git_buf buf = GIT_BUF_INIT_CONST(NULL, 0); |
|
123
|
|
|
|
|
|
|
|
|
124
|
|
|
|
|
|
|
CODE: |
|
125
|
2
|
|
|
|
|
|
list = GIT_SV_TO_PTR(Filter::List, self); |
|
126
|
|
|
|
|
|
|
|
|
127
|
2
|
|
|
|
|
|
repo = GIT_SV_TO_MAGIC(self); |
|
128
|
2
|
50
|
|
|
|
|
repo_ptr = INT2PTR(Repository, SvIV((SV *) repo)); |
|
129
|
|
|
|
|
|
|
|
|
130
|
2
|
|
|
|
|
|
rc = git_filter_list_apply_to_file( |
|
131
|
|
|
|
|
|
|
&buf, list, repo_ptr -> repository, path |
|
132
|
|
|
|
|
|
|
); |
|
133
|
2
|
50
|
|
|
|
|
if (rc != GIT_OK) |
|
134
|
0
|
|
|
|
|
|
git_buf_dispose(&buf); |
|
135
|
|
|
|
|
|
|
|
|
136
|
2
|
|
|
|
|
|
git_check_error(rc); |
|
137
|
2
|
|
|
|
|
|
RETVAL = newSVpv(buf.ptr, buf.size); |
|
138
|
2
|
|
|
|
|
|
git_buf_dispose(&buf); |
|
139
|
|
|
|
|
|
|
|
|
140
|
|
|
|
|
|
|
OUTPUT: RETVAL |
|
141
|
|
|
|
|
|
|
|
|
142
|
|
|
|
|
|
|
|
|
143
|
|
|
|
|
|
|
void |
|
144
|
|
|
|
|
|
|
DESTROY(self) |
|
145
|
|
|
|
|
|
|
SV* self |
|
146
|
|
|
|
|
|
|
|
|
147
|
|
|
|
|
|
|
PREINIT: |
|
148
|
|
|
|
|
|
|
Filter_List list; |
|
149
|
|
|
|
|
|
|
|
|
150
|
|
|
|
|
|
|
CODE: |
|
151
|
2
|
|
|
|
|
|
SvREFCNT_dec(GIT_SV_TO_MAGIC(self)); |
|
152
|
|
|
|
|
|
|
|
|
153
|
2
|
|
|
|
|
|
list = GIT_SV_TO_PTR(Filter::List, self); |
|
154
|
2
|
|
|
|
|
|
git_filter_list_free(list); |