Skip to content

Commit

Permalink
connect.c: drop path_match function
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jeff King authored and Junio C Hamano committed Dec 13, 2011
1 parent 1e7ba0f commit bab8d28
Show file tree
Hide file tree
Showing 2 changed files with 0 additions and 22 deletions.
1 change: 0 additions & 1 deletion cache.h
Original file line number Diff line number Diff line change
Expand Up @@ -1028,7 +1028,6 @@ extern char *git_getpass(const char *prompt);
extern struct child_process *git_connect(int fd[2], const char *url, const char *prog, int flags);
extern int finish_connect(struct child_process *conn);
extern int git_connection_is_socket(struct child_process *conn);
extern int path_match(const char *path, int nr, char **match);
struct extra_have_objects {
int nr, alloc;
unsigned char (*array)[20];
Expand Down
21 changes: 0 additions & 21 deletions connect.c
Original file line number Diff line number Diff line change
Expand Up @@ -105,27 +105,6 @@ int server_supports(const char *feature)
strstr(server_capabilities, feature) != NULL;
}

int path_match(const char *path, int nr, char **match)
{
int i;
int pathlen = strlen(path);

for (i = 0; i < nr; i++) {
char *s = match[i];
int len = strlen(s);

if (!len || len > pathlen)
continue;
if (memcmp(path + pathlen - len, s, len))
continue;
if (pathlen > len && path[pathlen - len - 1] != '/')
continue;
*s = 0;
return (i + 1);
}
return 0;
}

enum protocol {
PROTO_LOCAL = 1,
PROTO_SSH,
Expand Down

0 comments on commit bab8d28

Please sign in to comment.