From: Shawn O. Pearce Date: Tue, 4 Mar 2008 06:00:36 +0000 (-0500) Subject: Fix 'git remote show' regression on empty repository in 1.5.4 X-Git-Tag: v1.5.4.4~13 X-Git-Url: https://git.tokkee.org/?a=commitdiff_plain;h=52dce39762fbec75b2d561e5dedb25b8e51f83eb;p=git.git Fix 'git remote show' regression on empty repository in 1.5.4 Back in 18f7c51c we switched git-ls-remote/git-peek-remote to use the transport backend, rather than do everything itself. As part of that switch we started to produce a non-zero exit status if no refs were received from the remote peer, which happens when the remote peer has no commits pushed to it yet. (E.g. "git --git-dir=foo.git init; git ls-remote foo.git") Signed-off-by: Shawn O. Pearce Signed-off-by: Junio C Hamano --- diff --git a/builtin-ls-remote.c b/builtin-ls-remote.c index 6dd31d1dd..720280e39 100644 --- a/builtin-ls-remote.c +++ b/builtin-ls-remote.c @@ -94,10 +94,6 @@ int cmd_ls_remote(int argc, const char **argv, const char *prefix) transport_set_option(transport, TRANS_OPT_UPLOADPACK, uploadpack); ref = transport_get_remote_refs(transport); - - if (!ref) - return 1; - for ( ; ref; ref = ref->next) { if (!check_ref_type(ref, flags)) continue;