Skip to content

Commit bab8d28

Browse files
peffgitster
authored andcommitted
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 <[email protected]> Signed-off-by: Junio C Hamano <[email protected]>
1 parent 1e7ba0f commit bab8d28

File tree

2 files changed

+0
-22
lines changed

2 files changed

+0
-22
lines changed

cache.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1028,7 +1028,6 @@ extern char *git_getpass(const char *prompt);
10281028
extern struct child_process *git_connect(int fd[2], const char *url, const char *prog, int flags);
10291029
extern int finish_connect(struct child_process *conn);
10301030
extern int git_connection_is_socket(struct child_process *conn);
1031-
extern int path_match(const char *path, int nr, char **match);
10321031
struct extra_have_objects {
10331032
int nr, alloc;
10341033
unsigned char (*array)[20];

connect.c

Lines changed: 0 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -105,27 +105,6 @@ int server_supports(const char *feature)
105105
strstr(server_capabilities, feature) != NULL;
106106
}
107107

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-
129108
enum protocol {
130109
PROTO_LOCAL = 1,
131110
PROTO_SSH,

0 commit comments

Comments
 (0)