summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: fb0cc87)
raw | patch | inline | side by side (parent: fb0cc87)
author | Daniel Barkalow <barkalow@iabervon.org> | |
Wed, 18 Nov 2009 01:42:23 +0000 (02:42 +0100) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 18 Nov 2009 05:45:44 +0000 (21:45 -0800) |
Currently, it only checks url, but it will allow other things in the future.
Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Daniel Barkalow <barkalow@iabervon.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
remote.c | patch | blob | history |
diff --git a/remote.c b/remote.c
index 73d33f2584b061085fcaa0958c26b1c3d4665904..15c9cec60ba352a729171381182d4c98eff0bf30 100644 (file)
--- a/remote.c
+++ b/remote.c
#define BUF_SIZE (2048)
static char buffer[BUF_SIZE];
+static int valid_remote(const struct remote *remote)
+{
+ return !!remote->url;
+}
+
static const char *alias_url(const char *url, struct rewrites *r)
{
int i, j;
ret = make_remote(name, 0);
if (valid_remote_nick(name)) {
- if (!ret->url)
+ if (!valid_remote(ret))
read_remotes_file(ret);
- if (!ret->url)
+ if (!valid_remote(ret))
read_branches_file(ret);
}
- if (name_given && !ret->url)
+ if (name_given && !valid_remote(ret))
add_url_alias(ret, name);
- if (!ret->url)
+ if (!valid_remote(ret))
return NULL;
ret->fetch = parse_fetch_refspec(ret->fetch_refspec_nr, ret->fetch_refspec);
ret->push = parse_push_refspec(ret->push_refspec_nr, ret->push_refspec);