Fix tests under GETTEXT_POISON on parseopt
[gitweb.git] / http-push.c
index 44f814cda2a9756a55cb7f332d5fef0e5484256b..a832ca77a31245e8ef9c71adcc0d7110fcda1e5c 100644 (file)
@@ -904,7 +904,7 @@ static struct remote_lock *lock_remote(const char *path, long timeout)
                ep = strchr(ep + 1, '/');
        }
 
-       escaped = xml_entities(git_default_email);
+       escaped = xml_entities(ident_default_email());
        strbuf_addf(&out_buffer.buf, LOCK_REQUEST, escaped);
        free(escaped);
 
@@ -1108,7 +1108,7 @@ static void handle_remote_ls_ctx(struct xml_ctx *ctx, int tag_closed)
                                if (repo->path)
                                        url = repo->path;
                                if (strncmp(path, url, repo->path_len))
-                                       error("Parsed path '%s' does not match url: '%s'\n",
+                                       error("Parsed path '%s' does not match url: '%s'",
                                              path, url);
                                else {
                                        path += repo->path_len;
@@ -1702,7 +1702,7 @@ static int delete_remote_branch(const char *pattern, int force)
                run_active_slot(slot);
                free(url);
                if (results.curl_result != CURLE_OK)
-                       return error("DELETE request failed (%d/%ld)\n",
+                       return error("DELETE request failed (%d/%ld)",
                                     results.curl_result, results.http_code);
        } else {
                free(url);
@@ -1747,7 +1747,8 @@ int main(int argc, char **argv)
        int i;
        int new_refs;
        struct ref *ref, *local_refs;
-       struct remote *remote;
+
+       git_setup_gettext();
 
        git_extract_argv0_path(argv[0]);
 
@@ -1821,14 +1822,7 @@ int main(int argc, char **argv)
 
        memset(remote_dir_exists, -1, 256);
 
-       /*
-        * Create a minimum remote by hand to give to http_init(),
-        * primarily to allow it to look at the URL.
-        */
-       remote = xcalloc(sizeof(*remote), 1);
-       ALLOC_GROW(remote->url, remote->url_nr + 1, remote->url_alloc);
-       remote->url[remote->url_nr++] = repo->url;
-       http_init(remote);
+       http_init(NULL, repo->url, 1);
 
 #ifdef USE_CURL_MULTI
        is_running_queue = 0;
@@ -1877,8 +1871,8 @@ int main(int argc, char **argv)
        }
 
        /* match them up */
-       if (match_refs(local_refs, &remote_refs,
-                      nr_refspec, (const char **) refspec, push_all)) {
+       if (match_push_refs(local_refs, &remote_refs,
+                           nr_refspec, (const char **) refspec, push_all)) {
                rc = -1;
                goto cleanup;
        }