diff options
-rw-r--r-- | git.c | 11 | ||||
-rw-r--r-- | git.h | 1 |
2 files changed, 12 insertions, 0 deletions
@@ -576,6 +576,17 @@ file **get_branch_commits(git_branch *br) { return NULL; } +git_repo *get_repo(git_repo **repos, const char *name) { + if (!is_empty(name)) { + for (int i = 0; repos[i] != NULL; ++i) { + if (!is_empty(repos[i]->name) && !strcmp(repos[i]->name, name)) { + return repos[i]; + } + } + } + return NULL; +} + int create_pull_request_dir(pull_request *pr, index_t *idx, const char *root, const char *repo) { int ret = 0; struct stat st; @@ -55,6 +55,7 @@ extern void cleanup_pull_request(pull_request *pr); extern git_repo **init_git(config *cfg); extern pull_request *get_pull_request(index_t *idx, const char *root, const char *repo); extern int add_comment(comment *comment, const char *pr_root); +extern git_repo *get_repo(git_repo **repos, const char *name); extern int create_pull_request_dir(pull_request *pr, index_t *idx, const char *root, const char *repo); int parse_remote_branch(void *ctx, void *ret, const keyword *key, keyword_val val); |