diff options
author | Rene Scharfe <rene.scharfe@lsrfire.ath.cx> | 2008-07-25 12:41:21 +0200 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2008-07-25 17:16:12 -0700 |
commit | 6e94e6835f397cd2602ca1eb12002e51aa6b0500 (patch) | |
tree | 243d614ba5341500b1b5ea3994e106cdb85f1e21 /builtin-upload-archive.c | |
parent | d3296e37b61fdd80a8b785270b1d11db34dab2f5 (diff) | |
download | git-6e94e6835f397cd2602ca1eb12002e51aa6b0500.tar.gz |
archive: add write_archive()
Both archive and upload-archive have to parse command line arguments and
then call the archiver specific write function. Move the duplicate code
to a new function, write_archive().
Signed-off-by: Rene Scharfe <rene.scharfe@lsrfire.ath.cx>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 'builtin-upload-archive.c')
-rw-r--r-- | builtin-upload-archive.c | 10 |
1 files changed, 1 insertions, 9 deletions
diff --git a/builtin-upload-archive.c b/builtin-upload-archive.c index 13a6c6203e..cc37b36d99 100644 --- a/builtin-upload-archive.c +++ b/builtin-upload-archive.c @@ -19,12 +19,9 @@ static const char lostchild[] = static int run_upload_archive(int argc, const char **argv, const char *prefix) { - const struct archiver *ar; - struct archiver_args args; const char *sent_argv[MAX_ARGS]; const char *arg_cmd = "argument "; char *p, buf[4096]; - int treeish_idx; int sent_argc; int len; @@ -66,12 +63,7 @@ static int run_upload_archive(int argc, const char **argv, const char *prefix) sent_argv[sent_argc] = NULL; /* parse all options sent by the client */ - treeish_idx = parse_archive_args(sent_argc, sent_argv, &ar, &args); - - parse_treeish_arg(sent_argv + treeish_idx, &args, prefix); - parse_pathspec_arg(sent_argv + treeish_idx + 1, &args); - - return ar->write_archive(&args); + return write_archive(sent_argc, sent_argv, prefix, 0); } static void error_clnt(const char *fmt, ...) |