Merge branch 'bw/config-h'
[gitweb.git] / builtin / remote-ext.c
index 7457c743e8d8539c4f08df81f86c8b27c0bce392..bfb21ba7d217bafaf3527af007cd4ac4658d36c5 100644 (file)
@@ -3,6 +3,9 @@
 #include "run-command.h"
 #include "pkt-line.h"
 
+static const char usage_msg[] =
+       "git remote-ext <remote> <url>";
+
 /*
  * URL syntax:
  *     'command [arg1 [arg2 [...]]]'   Invoke command with given arguments.
@@ -128,9 +131,9 @@ static void send_git_request(int stdin_fd, const char *serv, const char *repo,
        const char *vhost)
 {
        if (!vhost)
-               packet_write(stdin_fd, "%s %s%c", serv, repo, 0);
+               packet_write_fmt(stdin_fd, "%s %s%c", serv, repo, 0);
        else
-               packet_write(stdin_fd, "%s %s%chost=%s%c", serv, repo, 0,
+               packet_write_fmt(stdin_fd, "%s %s%chost=%s%c", serv, repo, 0,
                             vhost, 0);
 }
 
@@ -168,7 +171,7 @@ static int command_loop(const char *child)
                size_t i;
                if (!fgets(buffer, MAXCOMMAND - 1, stdin)) {
                        if (ferror(stdin))
-                               die("Comammand input error");
+                               die("Command input error");
                        exit(0);
                }
                /* Strip end of line characters. */
@@ -193,7 +196,7 @@ static int command_loop(const char *child)
 int cmd_remote_ext(int argc, const char **argv, const char *prefix)
 {
        if (argc != 3)
-               die("Expected two arguments");
+               usage(usage_msg);
 
        return command_loop(argv[2]);
 }