unpack-trees: do not muck with attributes when we are not checking out
[git/git.git] / archive.h
CommitLineData
4df096a5
FBH
1#ifndef ARCHIVE_H
2#define ARCHIVE_H
3
4df096a5
FBH
4struct archiver_args {
5 const char *base;
d53fe818 6 size_t baselen;
4df096a5
FBH
7 struct tree *tree;
8 const unsigned char *commit_sha1;
8460b2fc 9 const struct commit *commit;
4df096a5
FBH
10 time_t time;
11 const char **pathspec;
e0ffb248 12 unsigned int verbose : 1;
3a176c6c 13 int compression_level;
4df096a5
FBH
14};
15
16typedef int (*write_archive_fn_t)(struct archiver_args *);
17
562e25ab
RS
18typedef int (*write_archive_entry_fn_t)(struct archiver_args *args, const unsigned char *sha1, const char *path, size_t pathlen, unsigned int mode, void *buffer, unsigned long size);
19
efd8696c
FBH
20/*
21 * Archive-format specific backends.
22 */
23extern int write_tar_archive(struct archiver_args *);
ec06bff5 24extern int write_zip_archive(struct archiver_args *);
4df096a5 25
562e25ab 26extern int write_archive_entries(struct archiver_args *args, write_archive_entry_fn_t write_entry);
6e94e683 27extern int write_archive(int argc, const char **argv, const char *prefix, int setup_prefix);
562e25ab 28
4df096a5 29#endif /* ARCHIVE_H */