Nguyễn Thái Ngọc Duy [off-list ref] writes:
quoted hunk ↗ jump to hunk
@@ -766,6 +771,14 @@ int cmd_clone(int argc, const char **argv, const char *prefix)
find_ref_by_name(mapped_refs, head.buf);
strbuf_release(&head);
+ if (!our_head_points_at) {
+ strbuf_addstr(&head, "refs/tags/");
+ strbuf_addstr(&head, option_branch);
+ our_head_points_at =
+ find_ref_by_name(mapped_refs, head.buf);
+ strbuf_release(&head);
+ }
+
Ok. I think this makes sense.