summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authornulltoken <emeric.fermas@gmail.com>2013-08-27 19:14:18 +0200
committernulltoken <emeric.fermas@gmail.com>2013-08-27 20:14:10 +0200
commitaec87f712fd1e84038d5d14b83a97d78e2e1b1ad (patch)
treee8ce5ea9b339c2aa67010eb90c725240b3021e87 /src
parent191adce8751e728111a3b1c3e9b2c02fe9f5d775 (diff)
downloadlibgit2-aec87f712fd1e84038d5d14b83a97d78e2e1b1ad.tar.gz
remote: Make git_remote_list() detect pushurl
Diffstat (limited to 'src')
-rw-r--r--src/remote.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/remote.c b/src/remote.c
index 7276daa39..10c1b5b81 100644
--- a/src/remote.c
+++ b/src/remote.c
@@ -1109,10 +1109,10 @@ int git_remote_list(git_strarray *remotes_list, git_repository *repo)
if (git_repository_config__weakptr(&cfg, repo) < 0)
return -1;
- if (git_vector_init(&list, 4, NULL) < 0)
+ if (git_vector_init(&list, 4, git__strcmp_cb) < 0)
return -1;
- if (regcomp(&preg, "^remote\\.(.*)\\.url$", REG_EXTENDED) < 0) {
+ if (regcomp(&preg, "^remote\\.(.*)\\.(push)?url$", REG_EXTENDED) < 0) {
giterr_set(GITERR_OS, "Remote catch regex failed to compile");
return -1;
}
@@ -1137,6 +1137,8 @@ int git_remote_list(git_strarray *remotes_list, git_repository *repo)
return error;
}
+ git_vector_uniq(&list, git__free);
+
remotes_list->strings = (char **)list.contents;
remotes_list->count = list.length;