aboutsummaryrefslogtreecommitdiffstats
path: root/builtin/fetch.c
diff options
context:
space:
mode:
Diffstat (limited to 'builtin/fetch.c')
-rw-r--r--builtin/fetch.c8
1 files changed, 8 insertions, 0 deletions
diff --git a/builtin/fetch.c b/builtin/fetch.c
index 95fd0018b9..f142756441 100644
--- a/builtin/fetch.c
+++ b/builtin/fetch.c
@@ -1766,6 +1766,14 @@ static int do_fetch(struct transport *transport,
branch->merge[i]->src);
}
}
+
+ /*
+ * If there are no refs specified to fetch, then we just
+ * fetch HEAD; mention that to narrow the advertisement.
+ */
+ if (!transport_ls_refs_options.ref_prefixes.nr)
+ strvec_push(&transport_ls_refs_options.ref_prefixes,
+ "HEAD");
}
if (tags == TAGS_SET || tags == TAGS_DEFAULT) {