X-Git-Url: https://oss.titaniummirror.com/gitweb?a=blobdiff_plain;f=stringutils.h;fp=stringutils.h;h=634745df00c8ddfdd0610dcb4dc4fe8bc21c74d5;hb=eefb116b6a88415e4a9e9a1d94f12781853df376;hp=16731dd3e4192f1b8c55f60fe5f555b2b7055dc0;hpb=f03727cda0f87c1f3f6ffcb88c0b9c18d4225ddf;p=repo_shell.git diff --git a/stringutils.h b/stringutils.h index 16731dd..634745d 100644 --- a/stringutils.h +++ b/stringutils.h @@ -40,4 +40,18 @@ bool str_has_word(const char* string, const char* word); */ bool match(const char* pattern, const char* string); +/* 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. + */ +char *strip_repo(const char *repo_name); + +/* Returns true if the repo is contained within string. repos are delimited by + * any whitespace characters, and the optional '.git' prefix is ignored during + * match. + */ +bool str_has_repo(const char* string, const char* repo); + #endif /* end of include guard: MYSTRTOK_H */