]> asedeno.scripts.mit.edu Git - git.git/blobdiff - transport.c
Merge branch 'maint' to sync with 1.5.6.3
[git.git] / transport.c
index a3b805258f2d1403f6b5de96f94738f2337f0627..6eb65b873afc9dfd457e974b63d88350bb8dc913 100644 (file)
@@ -441,10 +441,14 @@ static struct ref *get_refs_via_curl(struct transport *transport)
        struct ref *ref = NULL;
        struct ref *last_ref = NULL;
 
+       struct walker *walker;
+
        if (!transport->data)
                transport->data = get_http_walker(transport->url,
                                                transport->remote);
 
+       walker = transport->data;
+
        refs_url = xmalloc(strlen(transport->url) + 11);
        sprintf(refs_url, "%s/info/refs", transport->url);
 
@@ -500,6 +504,15 @@ static struct ref *get_refs_via_curl(struct transport *transport)
 
        strbuf_release(&buffer);
 
+       ref = alloc_ref_from_str("HEAD");
+       if (!walker->fetch_ref(walker, ref) &&
+           !resolve_remote_symref(ref, refs)) {
+               ref->next = refs;
+               refs = ref;
+       } else {
+               free(ref);
+       }
+
        return refs;
 }
 
@@ -532,9 +545,8 @@ static struct ref *get_refs_from_bundle(struct transport *transport)
                die ("Could not read bundle '%s'.", transport->url);
        for (i = 0; i < data->header.references.nr; i++) {
                struct ref_list_entry *e = data->header.references.list + i;
-               struct ref *ref = alloc_ref(strlen(e->name) + 1);
+               struct ref *ref = alloc_ref_from_str(e->name);
                hashcpy(ref->old_sha1, e->sha1);
-               strcpy(ref->name, e->name);
                ref->next = result;
                result = ref;
        }
@@ -633,7 +645,9 @@ static int fetch_refs_via_pack(struct transport *transport,
        args.lock_pack = 1;
        args.use_thin_pack = data->thin;
        args.include_tag = data->followtags;
-       args.verbose = transport->verbose > 0;
+       args.verbose = (transport->verbose > 0);
+       args.quiet = args.no_progress = (transport->verbose < 0);
+       args.no_progress = !isatty(1);
        args.depth = data->depth;
 
        for (i = 0; i < nr_heads; i++)
@@ -697,7 +711,8 @@ static int is_local(const char *url)
 {
        const char *colon = strchr(url, ':');
        const char *slash = strchr(url, '/');
-       return !colon || (slash && slash < colon);
+       return !colon || (slash && slash < colon) ||
+               has_dos_drive_prefix(url);
 }
 
 static int is_file(const char *url)