]> git.ipfire.org Git - thirdparty/git.git/blame - archive.h
submodules: fix of regression on fetching of non-init subsub-repo
[thirdparty/git.git] / archive.h
CommitLineData
4df096a5
FBH
1#ifndef ARCHIVE_H
2#define ARCHIVE_H
3
ef3ca954 4#include "cache.h"
f3e743a0
NTND
5#include "pathspec.h"
6
b612ee20
NTND
7struct repository;
8
4df096a5 9struct archiver_args {
b612ee20 10 struct repository *repo;
c397aac0 11 const char *refname;
2947a793 12 const char *prefix;
4df096a5 13 const char *base;
d53fe818 14 size_t baselen;
4df096a5 15 struct tree *tree;
bbf05cf7 16 const struct object_id *commit_oid;
8460b2fc 17 const struct commit *commit;
dddbad72 18 timestamp_t time;
f3e743a0 19 struct pathspec pathspec;
e0ffb248 20 unsigned int verbose : 1;
ba053ea9 21 unsigned int worktree_attributes : 1;
9cb513b7 22 unsigned int convert : 1;
3a176c6c 23 int compression_level;
2947a793 24 struct string_list extra_files;
4df096a5
FBH
25};
26
b612ee20
NTND
27/* main api */
28
55454427 29int write_archive(int argc, const char **argv, const char *prefix,
ad6dad09
DL
30 struct repository *repo,
31 const char *name_hint, int remote);
b612ee20
NTND
32
33const char *archive_format_from_filename(const char *filename);
34
35/* archive backend stuff */
36
13e0f88d 37#define ARCHIVER_WANT_COMPRESSION_LEVELS 1
7b97730b 38#define ARCHIVER_REMOTE 2
13e0f88d
JK
39struct archiver {
40 const char *name;
4d7c9898 41 int (*write_archive)(const struct archiver *, struct archiver_args *);
13e0f88d 42 unsigned flags;
4d7c9898 43 void *data;
13e0f88d 44};
55454427 45void register_archiver(struct archiver *);
4df096a5 46
55454427
DL
47void init_tar_archiver(void);
48void init_zip_archiver(void);
49void init_archivers(void);
562e25ab 50
9cb513b7 51typedef int (*write_archive_entry_fn_t)(struct archiver_args *args,
015ff4f8 52 const struct object_id *oid,
9cb513b7 53 const char *path, size_t pathlen,
200589ab
RS
54 unsigned int mode,
55 void *buffer, unsigned long size);
4df096a5 56
55454427 57int write_archive_entries(struct archiver_args *args, write_archive_entry_fn_t write_entry);
562e25ab 58
4df096a5 59#endif /* ARCHIVE_H */