remote rm/prune: print a message when writing packed-refs fails
[gitweb.git] / remote-testsvn.c
index 6be55cbe9ed6cf4979ac0971c30f127c9667ab2e..48bf6eb93b361a736d96e701749c16bae8d169a8 100644 (file)
@@ -175,8 +175,8 @@ static int cmd_import(const char *line)
        char *note_msg;
        unsigned char head_sha1[20];
        unsigned int startrev;
-       struct argv_array svndump_argv = ARGV_ARRAY_INIT;
-       struct child_process svndump_proc;
+       struct child_process svndump_proc = CHILD_PROCESS_INIT;
+       const char *command = "svnrdump";
 
        if (read_ref(private_ref, head_sha1))
                startrev = 0;
@@ -200,17 +200,15 @@ static int cmd_import(const char *line)
                if(dumpin_fd < 0)
                        die_errno("Couldn't open svn dump file %s.", url);
        } else {
-               memset(&svndump_proc, 0, sizeof(struct child_process));
                svndump_proc.out = -1;
-               argv_array_push(&svndump_argv, "svnrdump");
-               argv_array_push(&svndump_argv, "dump");
-               argv_array_push(&svndump_argv, url);
-               argv_array_pushf(&svndump_argv, "-r%u:HEAD", startrev);
-               svndump_proc.argv = svndump_argv.argv;
+               argv_array_push(&svndump_proc.args, command);
+               argv_array_push(&svndump_proc.args, "dump");
+               argv_array_push(&svndump_proc.args, url);
+               argv_array_pushf(&svndump_proc.args, "-r%u:HEAD", startrev);
 
                code = start_command(&svndump_proc);
                if (code)
-                       die("Unable to start %s, code %d", svndump_proc.argv[0], code);
+                       die("Unable to start %s, code %d", command, code);
                dumpin_fd = svndump_proc.out;
        }
        /* setup marks file import/export */
@@ -226,8 +224,7 @@ static int cmd_import(const char *line)
        if (!dump_from_file) {
                code = finish_command(&svndump_proc);
                if (code)
-                       warning("%s, returned %d", svndump_proc.argv[0], code);
-               argv_array_clear(&svndump_argv);
+                       warning("%s, returned %d", command, code);
        }
 
        return 0;