summaryrefslogtreecommitdiff
path: root/builtin
diff options
context:
space:
mode:
authorJunio C Hamano <gitster@pobox.com>2011-03-20 06:24:34 (GMT)
committerJunio C Hamano <gitster@pobox.com>2011-03-20 06:24:34 (GMT)
commit32b31ab7f3ff52eafc40033b890b313efaed8c56 (patch)
tree54d5497cda12f3d5120006d195fb856f6e4e7ee7 /builtin
parent9d59e6607a597a0a934566bfa547b45c7b57822c (diff)
parent1a92777504afc09e071d7d828e084e6a4dadfce2 (diff)
downloadgit-32b31ab7f3ff52eafc40033b890b313efaed8c56.zip
git-32b31ab7f3ff52eafc40033b890b313efaed8c56.tar.gz
git-32b31ab7f3ff52eafc40033b890b313efaed8c56.tar.bz2
Merge branch 'uk/ls-remote-in-get-remote-url'
* uk/ls-remote-in-get-remote-url: git-request-pull: open-code the only invocation of get_remote_url get_remote_url(): use the same data source as ls-remote to get remote urls
Diffstat (limited to 'builtin')
-rw-r--r--builtin/ls-remote.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/builtin/ls-remote.c b/builtin/ls-remote.c
index 97eed40..1a1ff87 100644
--- a/builtin/ls-remote.c
+++ b/builtin/ls-remote.c
@@ -33,6 +33,7 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix)
int i;
const char *dest = NULL;
unsigned flags = 0;
+ int get_url = 0;
int quiet = 0;
const char *uploadpack = NULL;
const char **pattern = NULL;
@@ -69,6 +70,10 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix)
quiet = 1;
continue;
}
+ if (!strcmp("--get-url", arg)) {
+ get_url = 1;
+ continue;
+ }
usage(ls_remote_usage);
}
dest = arg;
@@ -94,6 +99,12 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix)
}
if (!remote->url_nr)
die("remote %s has no configured URL", dest);
+
+ if (get_url) {
+ printf("%s\n", *remote->url);
+ return 0;
+ }
+
transport = transport_get(remote, NULL);
if (uploadpack != NULL)
transport_set_option(transport, TRANS_OPT_UPLOADPACK, uploadpack);