ls-remote: run setup_git_directory_gently() sooner

ls-remote already runs a repository search unconditionally to learn
about remote nicknames and "[url] insteadof" shortcuts.  Run that
search a little sooner, and now one can try

	[pager]
		ls-remote

to automatically paginate ls-remote output, or use repository-local

	[core]
		pager = whatever

with "git --paginate ls-remote <url>".

Signed-off-by: Nguyễn Thái Ngọc Duy <pclouds@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Signed-off-by: Jonathan Nieder <jrnieder@gmail.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
Nguyễn Thái Ngọc Duy
2010-08-05 22:20:08 -05:00
committed by Junio C Hamano
parent e0fce074fc
commit f0ef6a6eff
2 changed files with 2 additions and 5 deletions

View File

@ -32,7 +32,6 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix)
{
int i;
const char *dest = NULL;
int nongit;
unsigned flags = 0;
int quiet = 0;
const char *uploadpack = NULL;
@ -42,8 +41,6 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix)
struct transport *transport;
const struct ref *ref;
setup_git_directory_gently(&nongit);
for (i = 1; i < argc; i++) {
const char *arg = argv[i];