remote: New function remote_is_configured()

Previously, there was no easy way to check for the existence of a
configured remote. remote_get for example would always create the remote
"on demand".

This new function returns 1 if the remote is configured, 0 otherwise.

Signed-off-by: Finn Arne Gangstad <finnag@pvv.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Finn Arne Gangstad
2009-04-06 15:41:01 +02:00
committed by Junio C Hamano
parent bed5d42163
commit 9a23ba3375
2 changed files with 12 additions and 0 deletions

View File

@ -45,6 +45,7 @@ struct remote {
};
struct remote *remote_get(const char *name);
int remote_is_configured(const char *name);
typedef int each_remote_fn(struct remote *remote, void *priv);
int for_each_remote(each_remote_fn fn, void *priv);