Make the rest of commands work from a subdirectory.
[git.git] / http-push.c
index f3c92c9..c6e782c 100644 (file)
@@ -6,8 +6,6 @@
 #include "blob.h"
 #include "http.h"
 
-#ifdef USE_CURL_MULTI
-
 #include <expat.h>
 
 static const char http_push_usage[] =
@@ -786,7 +784,7 @@ static void handle_new_lock_ctx(struct xml_ctx *ctx, int tag_closed)
                                        strtol(ctx->cdata + 7, NULL, 10);
                } else if (!strcmp(ctx->name, DAV_ACTIVELOCK_TOKEN)) {
                        if (!strncmp(ctx->cdata, "opaquelocktoken:", 16)) {
-                               lock->token = xmalloc(strlen(ctx->cdata - 15));
+                               lock->token = xmalloc(strlen(ctx->cdata) - 15);
                                strcpy(lock->token, ctx->cdata + 16);
                        }
                }
@@ -1241,6 +1239,7 @@ int main(int argc, char **argv)
        int rc = 0;
        int i;
 
+       setup_git_directory();
        setup_ident();
 
        remote = xmalloc(sizeof(*remote));
@@ -1426,10 +1425,3 @@ int main(int argc, char **argv)
 
        return rc;
 }
-#else /* ifdef USE_CURL_MULTI */
-int main(int argc, char **argv)
-{
-       fprintf(stderr, "http-push requires curl 7.9.8 or higher.\n");
-       return 1;
-}
-#endif