summary | shortlog | log | commit | commitdiff | tree
raw | patch | inline | side by side (parent: bbaf458)
raw | patch | inline | side by side (parent: bbaf458)
author | Shawn O. Pearce <spearce@spearce.org> | |
Wed, 19 Sep 2007 04:49:27 +0000 (00:49 -0400) | ||
committer | Junio C Hamano <gitster@pobox.com> | |
Wed, 19 Sep 2007 10:22:31 +0000 (03:22 -0700) |
Anyplace we talk about the address of a remote repository we always
refer to it as a URL, especially in the configuration file and
.git/remotes where we call it "remote.$n.url" or start the first
line with "URL:". Calling this value a uri within the internal C
code just doesn't jive well with our commonly accepted terms.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
refer to it as a URL, especially in the configuration file and
.git/remotes where we call it "remote.$n.url" or start the first
line with "URL:". Calling this value a uri within the internal C
code just doesn't jive well with our commonly accepted terms.
Signed-off-by: Shawn O. Pearce <spearce@spearce.org>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
builtin-fetch.c | patch | blob | history | |
builtin-push.c | patch | blob | history | |
remote.c | patch | blob | history | |
remote.h | patch | blob | history | |
send-pack.c | patch | blob | history |
diff --git a/builtin-fetch.c b/builtin-fetch.c
index b9722e5fbd1c727c258d3efe07923d0c99c3f250..997a8ff954de919c35140b1523663d78176599c5 100644 (file)
--- a/builtin-fetch.c
+++ b/builtin-fetch.c
else
remote = remote_get(argv[i++]);
- transport = transport_get(remote, remote->uri[0]);
+ transport = transport_get(remote, remote->url[0]);
if (verbose >= 2)
transport->verbose = 1;
if (quiet)
diff --git a/builtin-push.c b/builtin-push.c
index 7d7e826a39707cbd81d346b7eef1e625bee4b417..4ee36c292d9d42f658673c5d37d80077d65dc855 100644 (file)
--- a/builtin-push.c
+++ b/builtin-push.c
refspec_nr = remote->push_refspec_nr;
}
errs = 0;
- for (i = 0; i < remote->uri_nr; i++) {
+ for (i = 0; i < remote->url_nr; i++) {
struct transport *transport =
- transport_get(remote, remote->uri[i]);
+ transport_get(remote, remote->url[i]);
int err;
if (receivepack)
transport_set_option(transport,
transport_set_option(transport, TRANS_OPT_THIN, "yes");
if (verbose)
- fprintf(stderr, "Pushing to %s\n", remote->uri[i]);
+ fprintf(stderr, "Pushing to %s\n", remote->url[i]);
err = transport_push(transport, refspec_nr, refspec, flags);
err |= transport_disconnect(transport);
if (!err)
continue;
- error("failed to push to '%s'", remote->uri[i]);
+ error("failed to push to '%s'", remote->url[i]);
errs++;
}
return !!errs;
diff --git a/remote.c b/remote.c
index 31e2b70d37d9c1b5b781c7276a65441445ac8c15..e3c3df556d540db887d0b0291a306fe073065d41 100644 (file)
--- a/remote.c
+++ b/remote.c
remote->fetch_refspec_nr = nr;
}
-static void add_uri(struct remote *remote, const char *uri)
+static void add_url(struct remote *remote, const char *url)
{
- int nr = remote->uri_nr + 1;
- remote->uri =
- xrealloc(remote->uri, nr * sizeof(char *));
- remote->uri[nr-1] = uri;
- remote->uri_nr = nr;
+ int nr = remote->url_nr + 1;
+ remote->url =
+ xrealloc(remote->url, nr * sizeof(char *));
+ remote->url[nr-1] = url;
+ remote->url_nr = nr;
}
static struct remote *make_remote(const char *name, int len)
switch (value_list) {
case 0:
- add_uri(remote, xstrdup(s));
+ add_url(remote, xstrdup(s));
break;
case 1:
add_push_refspec(remote, xstrdup(s));
} else {
branch = "refs/heads/master";
}
- add_uri(remote, p);
+ add_url(remote, p);
add_fetch_refspec(remote, branch);
remote->fetch_tags = 1; /* always auto-follow */
}
return 0; /* ignore unknown booleans */
}
if (!strcmp(subkey, ".url")) {
- add_uri(remote, xstrdup(value));
+ add_url(remote, xstrdup(value));
} else if (!strcmp(subkey, ".push")) {
add_push_refspec(remote, xstrdup(value));
} else if (!strcmp(subkey, ".fetch")) {
name = default_remote_name;
ret = make_remote(name, 0);
if (name[0] != '/') {
- if (!ret->uri)
+ if (!ret->url)
read_remotes_file(ret);
- if (!ret->uri)
+ if (!ret->url)
read_branches_file(ret);
}
- if (!ret->uri)
- add_uri(ret, name);
- if (!ret->uri)
+ if (!ret->url)
+ add_url(ret, name);
+ if (!ret->url)
return NULL;
ret->fetch = parse_ref_spec(ret->fetch_refspec_nr, ret->fetch_refspec);
ret->push = parse_ref_spec(ret->push_refspec_nr, ret->push_refspec);
return result;
}
-int remote_has_uri(struct remote *remote, const char *uri)
+int remote_has_url(struct remote *remote, const char *url)
{
int i;
- for (i = 0; i < remote->uri_nr; i++) {
- if (!strcmp(remote->uri[i], uri))
+ for (i = 0; i < remote->url_nr; i++) {
+ if (!strcmp(remote->url[i], url))
return 1;
}
return 0;
diff --git a/remote.h b/remote.h
index b5b558f1f14eee93994eec8a9b26778219b80503..05add06e48c0e759230b3384a6828851170ded67 100644 (file)
--- a/remote.h
+++ b/remote.h
struct remote {
const char *name;
- const char **uri;
- int uri_nr;
+ const char **url;
+ int url_nr;
const char **push_refspec;
struct refspec *push;
typedef int each_remote_fn(struct remote *remote, void *priv);
int for_each_remote(each_remote_fn fn, void *priv);
-int remote_has_uri(struct remote *remote, const char *uri);
+int remote_has_url(struct remote *remote, const char *url);
struct refspec {
unsigned force : 1;
diff --git a/send-pack.c b/send-pack.c
index f74e66a8babd427ecd715c901d3d1680f1c5f13a..4533d1bf8ebde7c78a1c7c550ce8feec1870fde0 100644 (file)
--- a/send-pack.c
+++ b/send-pack.c
if (remote_name) {
remote = remote_get(remote_name);
- if (!remote_has_uri(remote, dest)) {
+ if (!remote_has_url(remote, dest)) {
die("Destination %s is not a uri for %s",
dest, remote_name);
}