aboutsummaryrefslogtreecommitdiff
path: root/remote.c
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2009-04-12 16:46:41 -0700
committerJunio C Hamano <gitster@pobox.com>2009-04-12 16:46:41 -0700
commitc276857ee250ca1c3a36cba8358f50ba01e97917 (patch)
treed7146ab7ab5db2881e9d95efabca0e2c0e7d5244 /remote.c
parent07fb030efc7fd3d1833b53880dd39e98033326f6 (diff)
parent27845e9548b7b5b316d89f64546466f2004ee414 (diff)
downloadgit-c276857ee250ca1c3a36cba8358f50ba01e97917.tar.gz
git-c276857ee250ca1c3a36cba8358f50ba01e97917.tar.xz
Merge branch 'fg/remote-prune'
* fg/remote-prune: add tests for remote groups git remote update: Fallback to remote if group does not exist remote: New function remote_is_configured() git remote update: Report error for non-existing groups git remote update: New option --prune builtin-remote.c: Split out prune_remote as a separate function.
Diffstat (limited to 'remote.c')
-rw-r--r--remote.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/remote.c b/remote.c
index d12140e0f..a06761ace 100644
--- a/remote.c
+++ b/remote.c
@@ -667,6 +667,17 @@ struct remote *remote_get(const char *name)
return ret;
}
+int remote_is_configured(const char *name)
+{
+ int i;
+ read_config();
+
+ for (i = 0; i < remotes_nr; i++)
+ if (!strcmp(name, remotes[i]->name))
+ return 1;
+ return 0;
+}
+
int for_each_remote(each_remote_fn fn, void *priv)
{
int i, result = 0;