diff options
author | Junio C Hamano <gitster@pobox.com> | 2009-04-12 16:46:41 -0700 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2009-04-12 16:46:41 -0700 |
commit | c276857ee250ca1c3a36cba8358f50ba01e97917 (patch) | |
tree | d7146ab7ab5db2881e9d95efabca0e2c0e7d5244 /remote.c | |
parent | 07fb030efc7fd3d1833b53880dd39e98033326f6 (diff) | |
parent | 27845e9548b7b5b316d89f64546466f2004ee414 (diff) | |
download | git-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.c | 11 |
1 files changed, 11 insertions, 0 deletions
@@ -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; |