connect.c: drop path_match function

This function was used for comparing local and remote ref names during fetch (which makes it a candidate for "most confusingly named function of the year"). It no longer has any callers, so let's get rid of it. Signed-off-by: Jeff King <peff@peff.net> Signed-off-by: Junio C Hamano <gitster@pobox.com>

Jeff King committed Dec 12, 2011 at 19:49 UTC bab8d28e774c255a326ad5592af6351e4925efcb
2 files changed -22
cache.h
-1
@@ -1028,7 +1028,6 @@ extern char *git_getpass(const char *prompt);
1028 extern struct child_process *git_connect(int fd[2], const char *url, const char *prog, int flags);
1029 extern int finish_connect(struct child_process *conn);
1030 extern int git_connection_is_socket(struct child_process *conn);
1031 -extern int path_match(const char *path, int nr, char **match);
1031 struct extra_have_objects {
1032 int nr, alloc;
1033 unsigned char (*array)[20];
connect.c
-21
@@ -105,27 +105,6 @@ int server_supports(const char *feature)
105 strstr(server_capabilities, feature) != NULL;
106 }
107
108 -int path_match(const char *path, int nr, char **match)
109 -{
110 - int i;
111 - int pathlen = strlen(path);
112 -
113 - for (i = 0; i < nr; i++) {
114 - char *s = match[i];
115 - int len = strlen(s);
116 -
117 - if (!len || len > pathlen)
118 - continue;
119 - if (memcmp(path + pathlen - len, s, len))
120 - continue;
121 - if (pathlen > len && path[pathlen - len - 1] != '/')
122 - continue;
123 - *s = 0;
124 - return (i + 1);
125 - }
126 - return 0;
127 -}
128 -
108 enum protocol {
109 PROTO_LOCAL = 1,
110 PROTO_SSH,