refspec: remove the deprecated functions

Now that there are no callers of 'parse_push_refspec()', 'parse_fetch_refspec()', and 'free_refspec()', remove these functions. Signed-off-by: Brandon Williams <bmwill@google.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Brandon Williams committed May 16, 2018 at 15:58 UTC 860fdf1e6ebd767cf702d952e2dcdccd86e7a208
2 files changed -54
refspec.c
-49
@@ -121,55 +121,6 @@ static int parse_refspec(struct refspec_item *item, const char *refspec, int fet
121 return 1;
122 }
123
124 -static struct refspec_item *parse_refspec_internal(int nr_refspec, const char **refspec, int fetch, int verify)
125 -{
126 - int i;
127 - struct refspec_item *rs = xcalloc(nr_refspec, sizeof(*rs));
128 -
129 - for (i = 0; i < nr_refspec; i++) {
130 - if (!parse_refspec(&rs[i], refspec[i], fetch))
131 - goto invalid;
132 - }
133 -
134 - return rs;
135 -
136 - invalid:
137 - if (verify) {
138 - /*
139 - * nr_refspec must be greater than zero and i must be valid
140 - * since it is only possible to reach this point from within
141 - * the for loop above.
142 - */
143 - free_refspec(i+1, rs);
144 - return NULL;
145 - }
146 - die("Invalid refspec '%s'", refspec[i]);
147 -}
148 -
149 -struct refspec_item *parse_fetch_refspec(int nr_refspec, const char **refspec)
150 -{
151 - return parse_refspec_internal(nr_refspec, refspec, 1, 0);
152 -}
153 -
154 -struct refspec_item *parse_push_refspec(int nr_refspec, const char **refspec)
155 -{
156 - return parse_refspec_internal(nr_refspec, refspec, 0, 0);
157 -}
158 -
159 -void free_refspec(int nr_refspec, struct refspec_item *refspec)
160 -{
161 - int i;
162 -
163 - if (!refspec)
164 - return;
165 -
166 - for (i = 0; i < nr_refspec; i++) {
167 - free(refspec[i].src);
168 - free(refspec[i].dst);
169 - }
170 - free(refspec);
171 -}
172 -
124 void refspec_item_init(struct refspec_item *item, const char *refspec, int fetch)
125 {
126 memset(item, 0, sizeof(*item));
refspec.h
-5
@@ -14,11 +14,6 @@ struct refspec_item {
14 char *dst;
15 };
16
17 -struct refspec_item *parse_fetch_refspec(int nr_refspec, const char **refspec);
18 -struct refspec_item *parse_push_refspec(int nr_refspec, const char **refspec);
19 -
20 -void free_refspec(int nr_refspec, struct refspec_item *refspec);
21 -
17 #define REFSPEC_FETCH 1
18 #define REFSPEC_PUSH 0
19