Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/mono/libgit2.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCarlos Martín Nieto <carlos@cmartin.tk>2011-10-04 00:26:06 +0400
committerCarlos Martín Nieto <carlos@cmartin.tk>2011-10-08 04:12:26 +0400
commit4a3b18a62f99c836900c76d480ae33933098461c (patch)
tree1d4befdfaf88b0a13b1c79835b032f0de084fb73 /src/fetch.c
parentcd19ca9584bd01925e05e94e7f3bddae6880acda (diff)
A missing refspec is not an error
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 <carlos@cmartin.tk>
Diffstat (limited to 'src/fetch.c')
-rw-r--r--src/fetch.c10
1 files changed, 6 insertions, 4 deletions
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];