Merge branch 'ah/fix-http-push' into maint
authorJunio C Hamano <gitster@pobox.com>
Tue, 22 Jul 2014 17:29:07 +0000 (10:29 -0700)
committerJunio C Hamano <gitster@pobox.com>
Tue, 22 Jul 2014 17:29:07 +0000 (10:29 -0700)
* ah/fix-http-push:
http-push.c: make CURLOPT_IOCTLDATA a usable pointer

1  2 
http-push.c
diff --combined http-push.c
index de00d1693af902713ab5562e9d87fe621b02f955,3bcf8073eee90f4905911f4bba5f9bddcfb13ca6..bc94a3f6abeb3ddaa9d926fa051f740f691f6e6e
@@@ -64,7 -64,8 +64,7 @@@ enum XML_Status 
  #define LOCK_TIME 600
  #define LOCK_REFRESH 30
  
 -/* bits #0-15 in revision.h */
 -
 +/* Remember to update object flag allocation in object.h */
  #define LOCAL    (1u<<16)
  #define REMOTE   (1u<<17)
  #define FETCHING (1u<<18)
@@@ -199,7 -200,7 +199,7 @@@ static void curl_setup_http(CURL *curl
        curl_easy_setopt(curl, CURLOPT_READFUNCTION, fread_buffer);
  #ifndef NO_CURL_IOCTL
        curl_easy_setopt(curl, CURLOPT_IOCTLFUNCTION, ioctl_buffer);
-       curl_easy_setopt(curl, CURLOPT_IOCTLDATA, &buffer);
+       curl_easy_setopt(curl, CURLOPT_IOCTLDATA, buffer);
  #endif
        curl_easy_setopt(curl, CURLOPT_WRITEFUNCTION, write_fn);
        curl_easy_setopt(curl, CURLOPT_NOBODY, 0);
@@@ -770,7 -771,7 +770,7 @@@ static void handle_new_lock_ctx(struct 
                        lock->owner = xmalloc(strlen(ctx->cdata) + 1);
                        strcpy(lock->owner, ctx->cdata);
                } else if (!strcmp(ctx->name, DAV_ACTIVELOCK_TIMEOUT)) {
 -                      if (!prefixcmp(ctx->cdata, "Second-"))
 +                      if (starts_with(ctx->cdata, "Second-"))
                                lock->timeout =
                                        strtol(ctx->cdata + 7, NULL, 10);
                } else if (!strcmp(ctx->name, DAV_ACTIVELOCK_TOKEN)) {
@@@ -1578,7 -1579,7 +1578,7 @@@ static void fetch_symref(const char *pa
                return;
  
        /* If it's a symref, set the refname; otherwise try for a sha1 */
 -      if (!prefixcmp((char *)buffer.buf, "ref: ")) {
 +      if (starts_with((char *)buffer.buf, "ref: ")) {
                *symref = xmemdupz((char *)buffer.buf + 5, buffer.len - 6);
        } else {
                get_sha1_hex(buffer.buf, sha1);
@@@ -1732,7 -1733,7 +1732,7 @@@ int main(int argc, char **argv
  
        git_extract_argv0_path(argv[0]);
  
 -      repo = xcalloc(sizeof(*repo), 1);
 +      repo = xcalloc(1, sizeof(*repo));
  
        argv++;
        for (i = 1; i < argc; i++, argv++) {