summaryrefslogtreecommitdiff
path: root/src/clone.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/clone.c')
-rw-r--r--src/clone.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/clone.c b/src/clone.c
index 7352f5fb2..d75fee213 100644
--- a/src/clone.c
+++ b/src/clone.c
@@ -271,6 +271,12 @@ static int setup_remotes_and_fetch(
/* Create the "origin" remote */
if (!git_remote_add(&origin, repo, GIT_REMOTE_ORIGIN, origin_url)) {
+ /*
+ * Don't write FETCH_HEAD, we'll check out the remote tracking
+ * branch ourselves based on the server's default.
+ */
+ git_remote_set_update_fetchhead(origin, 0);
+
/* Connect and download everything */
if (!git_remote_connect(origin, GIT_DIR_FETCH)) {
if (!git_remote_download(origin, progress_cb, progress_payload)) {