remote-curl: pass ref SHA-1 to fetch-pack as well
[gitweb.git] / remote-curl.c
index c9b891adbf134193f07681a631ae368671e04aa6..25d67308c3cd54f3c39d8b1ca4d70e1776e0d948 100644 (file)
@@ -107,7 +107,7 @@ static struct ref *parse_git_refs(struct discovery *heads, int for_push)
 {
        struct ref *list = NULL;
        get_remote_heads(-1, heads->buf, heads->len, &list,
-                        for_push ? REF_NORMAL : 0, NULL);
+                        for_push ? REF_NORMAL : 0, NULL, NULL);
        return list;
 }
 
@@ -719,7 +719,8 @@ static int fetch_git(struct discovery *heads,
                struct ref *ref = to_fetch[i];
                if (!ref->name || !*ref->name)
                        die("cannot fetch by sha1 over smart http");
-               packet_buf_write(&preamble, "%s\n", ref->name);
+               packet_buf_write(&preamble, "%s %s\n",
+                                sha1_to_hex(ref->old_sha1), ref->name);
        }
        packet_buf_flush(&preamble);