Code

Merge branch 'jc/clone'
[git.git] / ssh-upload.c
index 603abcc8c3da9029a50fb7a2e76b0d6f70e2abeb..0b52ae15cbd216bff5002c89e0c8af84ea68ed1a 100644 (file)
 #include "rsh.h"
 #include "refs.h"
 
-#include <string.h>
-
 static unsigned char local_version = 1;
-static unsigned char remote_version = 0;
+static unsigned char remote_version;
 
-static int verbose = 0;
+static int verbose;
 
 static int serve_object(int fd_in, int fd_out) {
        ssize_t size;
@@ -121,6 +119,9 @@ int main(int argc, char **argv)
 
        prog = getenv(COUNTERPART_ENV_NAME);
        if (!prog) prog = COUNTERPART_PROGRAM_NAME;
+
+       setup_git_directory();
+
        while (arg < argc && argv[arg][0] == '-') {
                if (argv[arg][1] == 'w')
                        arg++;
@@ -131,7 +132,7 @@ int main(int argc, char **argv)
        commit_id = argv[arg];
        url = argv[arg + 1];
        if (get_sha1(commit_id, sha1))
-               usage(ssh_push_usage);
+               die("Not a valid object name %s", commit_id);
        memcpy(hex, sha1_to_hex(sha1), sizeof(hex));
        argv[arg] = hex;