X-Git-Url: https://oss.titaniummirror.com/gitweb?a=blobdiff_plain;f=git_acl.c;h=8783874b8472310f923ef85377b96fde0e35ee34;hb=eefb116b6a88415e4a9e9a1d94f12781853df376;hp=9c39ec2c08f62742e1cd8edace873b6591159235;hpb=f03727cda0f87c1f3f6ffcb88c0b9c18d4225ddf;p=repo_shell.git diff --git a/git_acl.c b/git_acl.c index 9c39ec2..8783874 100644 --- a/git_acl.c +++ b/git_acl.c @@ -107,26 +107,6 @@ static acl_clear(acl_t *acl) stra_destroy(&acl->userids); } -/* git tools match /path/to/repo against /path/to/repo.git when the former - * doesn't exist and the latter does. repo_shell addresses this by stripping - * the .git prefix off all repopath's read in from .gitacls and the SSH comand - * line. This mimics the expected git tool behavior except when /path/to/repo - * and /path/to/repo.git both exist. This case shouldn't ever be seen anyway. - */ -static char *strip_repo(const char *repo_name) -{ - if (!repo_name) - return NULL; - else { - char *dot = rindex(repo_name, '.'); - - if (dot && !strcmp(dot, ".git")) - return xstrndup(repo_name, dot - repo_name); - else - return xstrdup(repo_name); - } -} - static int acl_handler(void* user, const char* section, const char* name, const char* value) { @@ -143,12 +123,10 @@ static int acl_handler(void* user, const char* section, const char* name, stra_add(&acl->userids, name); } } else if (!strcmp(section, "repo_groups")) { - char *v = strip_repo(value); - if (str_has_word(v, acl->repo)) { + if (str_has_repo(value, acl->repo)) { //debug("repoids += '%s'", name); stra_add(&acl->repoids, name); } - free(v); } else if (!strncmp(section, "repo", 4)) { char *_p = xstrdup(section + 4); char *p = _p;