From 4a3b18a62f99c836900c76d480ae33933098461c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Carlos=20Mart=C3=ADn=20Nieto?= Date: Mon, 3 Oct 2011 22:26:06 +0200 Subject: A missing refspec is not an error MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit It's rare for a configured remote, but for one given as an URL on the command line, it's more often than not the case. Signed-off-by: Carlos Martín Nieto --- src/fetch.c | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'src/fetch.c') diff --git a/src/fetch.c b/src/fetch.c index 1bb896870..e8809d0cc 100644 --- a/src/fetch.c +++ b/src/fetch.c @@ -36,11 +36,13 @@ static int filter_wants(git_remote *remote) goto cleanup; } + /* + * The fetch refspec can be NULL, and what this means is that the + * user didn't specify one. This is fine, as it means that we're + * not interested in any particular branch but just the remote's + * HEAD, which will be stored in FETCH_HEAD after the fetch. + */ spec = git_remote_fetchspec(remote); - if (spec == NULL) { - error = git__throw(GIT_ERROR, "The remote has no fetchspec"); - goto cleanup; - } for (i = 0; i < refs.len; ++i) { git_remote_head *head = refs.heads[i]; -- cgit v1.2.1