From: Junio C Hamano Date: Tue, 22 Jul 2014 17:29:07 +0000 (-0700) Subject: Merge branch 'ah/fix-http-push' into maint X-Git-Tag: v2.0.3~3 X-Git-Url: https://git.lorimer.id.au/gitweb.git/diff_plain/cd989a97ec5bdb612693fbbed98b7adeb52a83a0?ds=inline;hp=-c Merge branch 'ah/fix-http-push' into maint * ah/fix-http-push: http-push.c: make CURLOPT_IOCTLDATA a usable pointer --- cd989a97ec5bdb612693fbbed98b7adeb52a83a0 diff --combined http-push.c index de00d1693a,3bcf8073ee..bc94a3f6ab --- a/http-push.c +++ b/http-push.c @@@ -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++) {