Merge branch 'en/header-split-cache-h-part-2'

More header clean-up.

* en/header-split-cache-h-part-2: (22 commits)
  reftable: ensure git-compat-util.h is the first (indirect) include
  diff.h: reduce unnecessary includes
  object-store.h: reduce unnecessary includes
  commit.h: reduce unnecessary includes
  fsmonitor: reduce includes of cache.h
  cache.h: remove unnecessary headers
  treewide: remove cache.h inclusion due to previous changes
  cache,tree: move basic name compare functions from read-cache to tree
  cache,tree: move cmp_cache_name_compare from tree.[ch] to read-cache.c
  hash-ll.h: split out of hash.h to remove dependency on repository.h
  tree-diff.c: move S_DIFFTREE_IFXMIN_NEQ define from cache.h
  dir.h: move DTYPE defines from cache.h
  versioncmp.h: move declarations for versioncmp.c functions from cache.h
  ws.h: move declarations for ws.c functions from cache.h
  match-trees.h: move declarations for match-trees.c functions from cache.h
  pkt-line.h: move declarations for pkt-line.c functions from cache.h
  base85.h: move declarations for base85.c functions from cache.h
  copy.h: move declarations for copy.c functions from cache.h
  server-info.h: move declarations for server-info.c functions from cache.h
  packfile.h: move pack_window and pack_entry from cache.h
  ...
This commit is contained in:
Junio C Hamano 2023-05-09 16:45:45 -07:00
commit ccd12a3d6c
217 changed files with 787 additions and 546 deletions

View File

@ -12,6 +12,7 @@
#include "dir.h"
#include "run-command.h"
#include "prompt.h"
#include "tree.h"
static void init_color(struct repository *r, struct add_i_state *s,
const char *section_and_slot, char *dst,

View File

@ -13,6 +13,7 @@
#include "blob.h"
#include "tree.h"
#include "commit.h"
#include "repository.h"
#include "tag.h"
#include "alloc.h"

View File

@ -10,6 +10,7 @@
#include "cache.h"
#include "abspath.h"
#include "alloc.h"
#include "base85.h"
#include "config.h"
#include "object-store.h"
#include "blob.h"
@ -30,6 +31,8 @@
#include "apply.h"
#include "entry.h"
#include "setup.h"
#include "symlinks.h"
#include "ws.h"
#include "wrapper.h"
struct gitdiff_data {

View File

@ -1,7 +1,7 @@
#ifndef APPLY_H
#define APPLY_H
#include "hash.h"
#include "hash-ll.h"
#include "lockfile.h"
#include "string-list.h"
#include "strmap.h"

View File

@ -1,7 +1,7 @@
/*
* Copyright (c) 2006 Rene Scharfe
*/
#include "cache.h"
#include "git-compat-util.h"
#include "config.h"
#include "archive.h"
#include "gettext.h"

View File

@ -6,10 +6,12 @@
#include "environment.h"
#include "gettext.h"
#include "hex.h"
#include "pretty.h"
#include "setup.h"
#include "refs.h"
#include "object-store.h"
#include "commit.h"
#include "tree.h"
#include "tree-walk.h"
#include "attr.h"
#include "archive.h"

1
attr.c
View File

@ -20,6 +20,7 @@
#include "object-store.h"
#include "setup.h"
#include "thread-utils.h"
#include "tree-walk.h"
const char git_attr__true[] = "(builtin)true";
const char git_attr__false[] = "\0(builtin)false";

View File

@ -1,4 +1,5 @@
#include "cache.h"
#include "git-compat-util.h"
#include "base85.h"
#undef DEBUG_85

7
base85.h Normal file
View File

@ -0,0 +1,7 @@
#ifndef BASE85_H
#define BASE85_H
int decode_85(char *dst, const char *line, int linelen);
void encode_85(char *buf, const unsigned char *data, int bytes);
#endif /* BASE85_H */

View File

@ -6,6 +6,7 @@
#include "hashmap.h"
#include "commit-graph.h"
#include "commit.h"
#include "commit-slab.h"
define_commit_slab(bloom_filter_slab, struct bloom_filter);

View File

@ -9,6 +9,7 @@
#include "refs.h"
#include "refspec.h"
#include "remote.h"
#include "repository.h"
#include "sequencer.h"
#include "commit.h"
#include "worktree.h"

View File

@ -2,6 +2,7 @@
#include "builtin.h"
#include "gettext.h"
#include "parse-options.h"
#include "repository.h"
#include "apply.h"
static const char * const apply_usage[] = {

View File

@ -9,6 +9,7 @@
#include "transport.h"
#include "parse-options.h"
#include "pkt-line.h"
#include "repository.h"
#include "sideband.h"
static void create_output_file(const char *output_file)

View File

@ -1,5 +1,6 @@
#include "builtin.h"
#include "cache.h"
#include "copy.h"
#include "environment.h"
#include "gettext.h"
#include "hex.h"

View File

@ -4,6 +4,8 @@
#include "setup.h"
#include "strvec.h"
#include "parse-options.h"
#include "pkt-line.h"
#include "repository.h"
#include "cache.h"
#include "bundle.h"

View File

@ -7,6 +7,7 @@
#include "gettext.h"
#include "object-name.h"
#include "quote.h"
#include "repository.h"
#include "setup.h"
#include "parse-options.h"
#include "write-or-die.h"

View File

@ -7,6 +7,7 @@
#include "quote.h"
#include "pathspec.h"
#include "parse-options.h"
#include "repository.h"
#include "submodule.h"
#include "write-or-die.h"

View File

@ -11,6 +11,7 @@
#include "gettext.h"
#include "lockfile.h"
#include "quote.h"
#include "repository.h"
#include "cache-tree.h"
#include "parse-options.h"
#include "entry.h"

View File

@ -28,6 +28,7 @@
#include "setup.h"
#include "submodule.h"
#include "submodule-config.h"
#include "symlinks.h"
#include "trace2.h"
#include "tree.h"
#include "tree-walk.h"

View File

@ -14,6 +14,7 @@
#include "dir.h"
#include "gettext.h"
#include "parse-options.h"
#include "repository.h"
#include "setup.h"
#include "string-list.h"
#include "quote.h"

View File

@ -13,6 +13,7 @@
#include "abspath.h"
#include "advice.h"
#include "config.h"
#include "copy.h"
#include "environment.h"
#include "gettext.h"
#include "hex.h"
@ -38,6 +39,7 @@
#include "setup.h"
#include "connected.h"
#include "packfile.h"
#include "pkt-line.h"
#include "list-objects-filter-options.h"
#include "hook.h"
#include "bundle.h"

View File

@ -9,6 +9,7 @@
#include "ident.h"
#include "parse-options.h"
#include "urlmatch.h"
#include "path.h"
#include "quote.h"
#include "setup.h"
#include "worktree.h"

View File

@ -1,6 +1,7 @@
#include "builtin.h"
#include "gettext.h"
#include "parse-options.h"
#include "path.h"
#include "wrapper.h"
#include "write-or-die.h"

View File

@ -3,6 +3,7 @@
#include "gettext.h"
#include "lockfile.h"
#include "credential.h"
#include "path.h"
#include "string-list.h"
#include "parse-options.h"
#include "write-or-die.h"

View File

@ -9,6 +9,7 @@
#include "builtin.h"
#include "submodule.h"
#include "repository.h"
#include "tree.h"
static struct rev_info log_tree_opt;

View File

@ -22,6 +22,7 @@
#include "setup.h"
#include "submodule.h"
#include "oid-array.h"
#include "tree.h"
#define DIFF_NO_INDEX_EXPLICIT 1
#define DIFF_NO_INDEX_IMPLICIT 2

View File

@ -15,6 +15,7 @@
#include "cache.h"
#include "abspath.h"
#include "config.h"
#include "copy.h"
#include "builtin.h"
#include "run-command.h"
#include "environment.h"

View File

@ -29,6 +29,7 @@
#include "utf8.h"
#include "packfile.h"
#include "pager.h"
#include "pkt-line.h"
#include "list-objects-filter-options.h"
#include "commit-reach.h"
#include "branch.h"

View File

@ -3,6 +3,8 @@
#include "builtin.h"
#include "gettext.h"
#include "parse-options.h"
#include "path.h"
#include "repository.h"
#include "run-command.h"
#include "string-list.h"

View File

@ -12,6 +12,7 @@
#include "builtin.h"
#include "abspath.h"
#include "date.h"
#include "environment.h"
#include "hex.h"
#include "repository.h"

View File

@ -8,6 +8,7 @@
#include "gettext.h"
#include "pager.h"
#include "parse-options.h"
#include "path.h"
#include "run-command.h"
#include "config-list.h"
#include "help.h"

View File

@ -6,6 +6,7 @@
#include "cache.h"
#include "abspath.h"
#include "config.h"
#include "copy.h"
#include "environment.h"
#include "gettext.h"
#include "refs.h"
@ -13,6 +14,7 @@
#include "exec-cmd.h"
#include "object-file.h"
#include "parse-options.h"
#include "path.h"
#include "setup.h"
#include "worktree.h"
#include "wrapper.h"

View File

@ -44,6 +44,7 @@
#include "commit-reach.h"
#include "range-diff.h"
#include "tmp-objdir.h"
#include "tree.h"
#include "write-or-die.h"
#define MAIL_DEFAULT_WRAP 72

View File

@ -3,6 +3,7 @@
#include "gettext.h"
#include "hex.h"
#include "transport.h"
#include "pkt-line.h"
#include "ref-filter.h"
#include "remote.h"
#include "refs.h"

View File

@ -1,6 +1,7 @@
#define USE_THE_INDEX_VARIABLE
#include "builtin.h"
#include "hex.h"
#include "repository.h"
#include "run-command.h"
static const char *pgm;

View File

@ -3,9 +3,11 @@
#include "advice.h"
#include "commit.h"
#include "gettext.h"
#include "hash.h"
#include "tag.h"
#include "merge-recursive.h"
#include "object-name.h"
#include "repository.h"
#include "xdiff-interface.h"
static const char builtin_merge_recursive_usage[] =

View File

@ -16,6 +16,7 @@
#include "exec-cmd.h"
#include "merge-blobs.h"
#include "quote.h"
#include "tree.h"
static int line_termination = '\n';

View File

@ -18,6 +18,7 @@
#include "cache-tree.h"
#include "string-list.h"
#include "parse-options.h"
#include "repository.h"
#include "setup.h"
#include "submodule.h"
#include "entry.h"

View File

@ -14,6 +14,8 @@
#include "remote.h"
#include "transport.h"
#include "parse-options.h"
#include "pkt-line.h"
#include "repository.h"
#include "submodule.h"
#include "submodule-config.h"
#include "send-pack.h"

View File

@ -19,6 +19,7 @@
#include "dir.h"
#include "builtin.h"
#include "parse-options.h"
#include "repository.h"
#include "resolve-undo.h"
#include "setup.h"
#include "submodule.h"

View File

@ -33,6 +33,7 @@
#include "object-store.h"
#include "protocol.h"
#include "commit-reach.h"
#include "server-info.h"
#include "trace.h"
#include "trace2.h"
#include "worktree.h"

View File

@ -7,6 +7,7 @@
#include "hex.h"
#include "parse-options.h"
#include "run-command.h"
#include "server-info.h"
#include "sigchain.h"
#include "strbuf.h"
#include "string-list.h"

View File

@ -4,6 +4,7 @@
#include "dir.h"
#include "gettext.h"
#include "parse-options.h"
#include "repository.h"
#include "string-list.h"
#include "rerere.h"
#include "wrapper.h"

View File

@ -12,9 +12,11 @@
#include "dir.h"
#include "cache-tree.h"
#include "gettext.h"
#include "hash.h"
#include "tree-walk.h"
#include "object-name.h"
#include "parse-options.h"
#include "repository.h"
#include "string-list.h"
#include "setup.h"
#include "submodule.h"

View File

@ -2,6 +2,7 @@
#include "config.h"
#include "environment.h"
#include "gettext.h"
#include "hash.h"
#include "hex.h"
#include "pretty.h"
#include "refs.h"
@ -10,6 +11,7 @@
#include "strvec.h"
#include "object-name.h"
#include "parse-options.h"
#include "repository.h"
#include "dir.h"
#include "commit-slab.h"
#include "date.h"

View File

@ -1,9 +1,11 @@
#include "builtin.h"
#include "cache.h"
#include "gettext.h"
#include "hash.h"
#include "hex.h"
#include "pack.h"
#include "parse-options.h"
#include "repository.h"
static const char *const show_index_usage[] = {
"git show-index [--object-format=<hash-algorithm>]",

View File

@ -9,6 +9,7 @@
#include "config.h"
#include "environment.h"
#include "gettext.h"
#include "hash.h"
#include "hex.h"
#include "lockfile.h"
#include "quote.h"
@ -21,8 +22,10 @@
#include "parse-options.h"
#include "pathspec.h"
#include "dir.h"
#include "repository.h"
#include "setup.h"
#include "split-index.h"
#include "symlinks.h"
#include "fsmonitor.h"
#include "write-or-die.h"

View File

@ -1,11 +1,13 @@
#include "cache.h"
#include "config.h"
#include "gettext.h"
#include "hash.h"
#include "refs.h"
#include "builtin.h"
#include "object-name.h"
#include "parse-options.h"
#include "quote.h"
#include "repository.h"
#include "strvec.h"
static const char * const git_update_ref_usage[] = {

View File

@ -3,6 +3,7 @@
#include "builtin.h"
#include "gettext.h"
#include "parse-options.h"
#include "server-info.h"
static const char * const update_server_info_usage[] = {
"git update-server-info [-f | --force]",

View File

@ -6,6 +6,7 @@
#include "archive.h"
#include "pkt-line.h"
#include "sideband.h"
#include "repository.h"
#include "run-command.h"
#include "strvec.h"

View File

@ -2,6 +2,7 @@
#include "abspath.h"
#include "checkout.h"
#include "config.h"
#include "copy.h"
#include "builtin.h"
#include "dir.h"
#include "environment.h"
@ -13,6 +14,7 @@
#include "strvec.h"
#include "branch.h"
#include "refs.h"
#include "repository.h"
#include "run-command.h"
#include "hook.h"
#include "sigchain.h"

View File

@ -13,6 +13,7 @@
#include "tree.h"
#include "cache-tree.h"
#include "parse-options.h"
#include "repository.h"
static const char * const write_tree_usage[] = {
N_("git write-tree [--missing-ok] [--prefix=<prefix>/]"),

View File

@ -1,6 +1,7 @@
#include "cache.h"
#include "git-compat-util.h"
#include "bundle-uri.h"
#include "bundle.h"
#include "copy.h"
#include "environment.h"
#include "gettext.h"
#include "object-store.h"

122
cache.h
View File

@ -4,41 +4,10 @@
#include "git-compat-util.h"
#include "strbuf.h"
#include "hashmap.h"
#include "gettext.h"
#include "string-list.h"
#include "pathspec.h"
#include "object.h"
#include "statinfo.h"
#if defined(DT_UNKNOWN) && !defined(NO_D_TYPE_IN_DIRENT)
#define DTYPE(de) ((de)->d_type)
#else
#undef DT_UNKNOWN
#undef DT_DIR
#undef DT_REG
#undef DT_LNK
#define DT_UNKNOWN 0
#define DT_DIR 1
#define DT_REG 2
#define DT_LNK 3
#define DTYPE(de) DT_UNKNOWN
#endif
/*
* Some mode bits are also used internally for computations.
*
* They *must* not overlap with any valid modes, and they *must* not be emitted
* to outside world - i.e. appear on disk or network. In other words, it's just
* temporary fields, which we internally use, but they have to stay in-house.
*
* ( such approach is valid, as standard S_IF* fits into 16 bits, and in Git
* codebase mode is `unsigned int` which is assumed to be at least 32 bits )
*/
/* used internally in tree-diff */
#define S_DIFFTREE_IFXMIN_NEQ 0x80000000
/*
* Basic data structures for the directory cache
*/
@ -586,64 +555,7 @@ extern int verify_ce_order;
#define DATA_CHANGED 0x0020
#define TYPE_CHANGED 0x0040
int base_name_compare(const char *name1, size_t len1, int mode1,
const char *name2, size_t len2, int mode2);
int df_name_compare(const char *name1, size_t len1, int mode1,
const char *name2, size_t len2, int mode2);
int name_compare(const char *name1, size_t len1, const char *name2, size_t len2);
int cache_name_stage_compare(const char *name1, int len1, int stage1, const char *name2, int len2, int stage2);
struct cache_def {
struct strbuf path;
int flags;
int track_flags;
int prefix_len_stat_func;
};
#define CACHE_DEF_INIT { \
.path = STRBUF_INIT, \
}
static inline void cache_def_clear(struct cache_def *cache)
{
strbuf_release(&cache->path);
}
int has_symlink_leading_path(const char *name, int len);
int threaded_has_symlink_leading_path(struct cache_def *, const char *, int);
int check_leading_path(const char *name, int len, int warn_on_lstat_err);
int has_dirs_only_path(const char *name, int len, int prefix_len);
void invalidate_lstat_cache(void);
void schedule_dir_for_removal(const char *name, int len);
void remove_scheduled_dirs(void);
struct pack_window {
struct pack_window *next;
unsigned char *base;
off_t offset;
size_t len;
unsigned int last_used;
unsigned int inuse_cnt;
};
struct pack_entry {
off_t offset;
struct packed_git *p;
};
/* Dumb servers support */
int update_server_info(int);
#define COPY_READ_ERROR (-2)
#define COPY_WRITE_ERROR (-3)
int copy_fd(int ifd, int ofd);
int copy_file(const char *dst, const char *src, int mode);
int copy_file_with_time(const char *dst, const char *src, int mode);
/* base85 */
int decode_85(char *dst, const char *line, int linelen);
void encode_85(char *buf, const unsigned char *data, int bytes);
/* pkt-line.c */
void packet_trace_identity(const char *prog);
int cmp_cache_name_compare(const void *a_, const void *b_);
/* add */
/*
@ -655,36 +567,6 @@ int add_files_to_cache(const char *prefix, const struct pathspec *pathspec, int
/* diff.c */
extern int diff_auto_refresh_index;
/* match-trees.c */
void shift_tree(struct repository *, const struct object_id *, const struct object_id *, struct object_id *, int);
void shift_tree_by(struct repository *, const struct object_id *, const struct object_id *, struct object_id *, const char *);
/*
* whitespace rules.
* used by both diff and apply
* last two digits are tab width
*/
#define WS_BLANK_AT_EOL 0100
#define WS_SPACE_BEFORE_TAB 0200
#define WS_INDENT_WITH_NON_TAB 0400
#define WS_CR_AT_EOL 01000
#define WS_BLANK_AT_EOF 02000
#define WS_TAB_IN_INDENT 04000
#define WS_TRAILING_SPACE (WS_BLANK_AT_EOL|WS_BLANK_AT_EOF)
#define WS_DEFAULT_RULE (WS_TRAILING_SPACE|WS_SPACE_BEFORE_TAB|8)
#define WS_TAB_WIDTH_MASK 077
/* All WS_* -- when extended, adapt diff.c emit_symbol */
#define WS_RULE_MASK 07777
extern unsigned whitespace_rule_cfg;
unsigned whitespace_rule(struct index_state *, const char *);
unsigned parse_whitespace_rule(const char *);
unsigned ws_check(const char *line, int len, unsigned ws_rule);
void ws_check_emit(const char *line, int len, unsigned ws_rule, FILE *stream, const char *set, const char *reset, const char *ws);
char *whitespace_error_string(unsigned ws);
void ws_fix_copy(struct strbuf *, const char *, int, unsigned, int *);
int ws_blank_line(const char *line, int len);
#define ws_tab_width(rule) ((rule) & WS_TAB_WIDTH_MASK)
/* ls-files */
void overlay_tree_on_index(struct index_state *istate,
const char *tree_name, const char *prefix);
@ -730,6 +612,4 @@ int stat_validity_check(struct stat_validity *sv, const char *path);
*/
void stat_validity_update(struct stat_validity *sv, int fd);
int versioncmp(const char *s1, const char *s2);
#endif /* CACHE_H */

View File

@ -2,6 +2,7 @@
#include "object-name.h"
#include "remote.h"
#include "refspec.h"
#include "repository.h"
#include "checkout.h"
#include "config.h"
#include "strbuf.h"

View File

@ -1,7 +1,7 @@
#ifndef CHECKOUT_H
#define CHECKOUT_H
#include "hash.h"
#include "hash-ll.h"
/*
* Check if the branch name uniquely matches a branch name on a remote

View File

@ -3,6 +3,7 @@
#include "chunk-format.h"
#include "csum-file.h"
#include "gettext.h"
#include "hash.h"
#include "trace2.h"
/*

View File

@ -1,7 +1,7 @@
#ifndef CHUNK_FORMAT_H
#define CHUNK_FORMAT_H
#include "hash.h"
#include "hash-ll.h"
struct hashfile;
struct chunkfile;

View File

@ -1,10 +1,11 @@
#include "cache.h"
#include "git-compat-util.h"
#include "config.h"
#include "color.h"
#include "editor.h"
#include "gettext.h"
#include "hex.h"
#include "pager.h"
#include "strbuf.h"
static int git_use_color_default = GIT_COLOR_AUTO;
int color_stdout_is_tty = -1;

View File

@ -1,4 +1,4 @@
#include "cache.h"
#include "git-compat-util.h"
#include "object-store.h"
#include "commit.h"
#include "convert.h"
@ -13,6 +13,7 @@
#include "xdiff/xmacros.h"
#include "log-tree.h"
#include "refs.h"
#include "tree.h"
#include "userdiff.h"
#include "oid-array.h"
#include "revision.h"

View File

@ -23,6 +23,7 @@
#include "shallow.h"
#include "json-writer.h"
#include "trace2.h"
#include "tree.h"
#include "chunk-format.h"
#include "wrapper.h"

View File

@ -26,6 +26,7 @@
#include "run-command.h"
#include "setup.h"
#include "shallow.h"
#include "tree.h"
#include "hook.h"
static struct commit_extra_header *read_commit_extra_header_lines(const char *buf, size_t len, const char **);

View File

@ -2,13 +2,10 @@
#define COMMIT_H
#include "object.h"
#include "tree.h"
#include "strbuf.h"
#include "decorate.h"
#include "gpg-interface.h"
#include "string-list.h"
#include "pretty.h"
#include "commit-slab.h"
struct signature_check;
struct strbuf;
struct tree;
#define COMMIT_NOT_FROM_GRAPH 0xFFFFFFFF
#define GENERATION_NUMBER_INFINITY ((1ULL << 63) - 1)

View File

@ -1,8 +1,10 @@
#include "cache.h"
#include "git-compat-util.h"
#include "exec-cmd.h"
#include "gettext.h"
#include "attr.h"
#include "repository.h"
#include "setup.h"
#include "strbuf.h"
#include "trace2.h"
/*

View File

@ -1,4 +1,4 @@
#include "cache.h"
#include "git-compat-util.h"
#include "config.h"
#include "fsmonitor.h"
#include "fsm-health.h"

View File

@ -1,6 +1,8 @@
#include "cache.h"
#include "git-compat-util.h"
#include "config.h"
#include "gettext.h"
#include "hex.h"
#include "repository.h"
#include "strbuf.h"
#include "fsmonitor.h"
#include "fsmonitor-ipc.h"

View File

@ -1,6 +1,7 @@
#include "git-compat-util.h"
#include "config.h"
#include "fsmonitor-ipc.h"
#include "path.h"
const char *fsmonitor_ipc__get_path(struct repository *r) {
static char *ret;

View File

@ -23,12 +23,13 @@
#endif
#endif
#include "cache.h"
#include "git-compat-util.h"
#include "fsmonitor.h"
#include "fsm-listen.h"
#include "fsmonitor--daemon.h"
#include "fsmonitor-path-utils.h"
#include "gettext.h"
#include "string-list.h"
struct fsm_listen_data
{

View File

@ -13,6 +13,7 @@
#include "../config.h"
#include "../environment.h"
#include "../trace2.h"
#include "../symlinks.h"
#include "../wrapper.h"
#include "dir.h"
#include "gettext.h"

View File

@ -9,6 +9,7 @@
#include "config.h"
#include "environment.h"
#include "gettext.h"
#include "path.h"
#include "utf8.h"
#include "precompose_utf8.h"

View File

@ -1,5 +1,6 @@
#include "../../cache.h"
#include "../../json-writer.h"
#include "../../repository.h"
#include "../../trace2.h"
#include "lazyload.h"
#include <Psapi.h>

View File

@ -5,7 +5,7 @@
* Copyright (C) Johannes Schindelin, 2005
*
*/
#include "cache.h"
#include "git-compat-util.h"
#include "abspath.h"
#include "advice.h"
#include "alloc.h"
@ -35,6 +35,7 @@
#include "setup.h"
#include "trace2.h"
#include "worktree.h"
#include "ws.h"
#include "wrapper.h"
#include "write-or-die.h"

View File

@ -2,6 +2,7 @@
#include "advice.h"
#include "config.h"
#include "convert.h"
#include "copy.h"
#include "gettext.h"
#include "hex.h"
#include "object-store.h"

View File

@ -4,7 +4,7 @@
#ifndef CONVERT_H
#define CONVERT_H
#include "hash.h"
#include "hash-ll.h"
#include "string-list.h"
struct index_state;

4
copy.c
View File

@ -1,4 +1,6 @@
#include "cache.h"
#include "git-compat-util.h"
#include "copy.h"
#include "path.h"
#include "wrapper.h"
int copy_fd(int ifd, int ofd)

10
copy.h Normal file
View File

@ -0,0 +1,10 @@
#ifndef COPY_H
#define COPY_H
#define COPY_READ_ERROR (-2)
#define COPY_WRITE_ERROR (-3)
int copy_fd(int ifd, int ofd);
int copy_file(const char *dst, const char *src, int mode);
int copy_file_with_time(const char *dst, const char *src, int mode);
#endif /* COPY_H */

View File

@ -1,4 +1,4 @@
#include "cache.h"
#include "git-compat-util.h"
#include "abspath.h"
#include "config.h"
#include "credential.h"
@ -8,6 +8,7 @@
#include "url.h"
#include "prompt.h"
#include "sigchain.h"
#include "strbuf.h"
#include "urlmatch.h"
#include "git-compat-util.h"

View File

@ -10,6 +10,7 @@
#include "git-compat-util.h"
#include "progress.h"
#include "csum-file.h"
#include "hash.h"
#include "wrapper.h"
static void verify_buffer_or_die(struct hashfile *f,

View File

@ -1,7 +1,7 @@
#ifndef CSUM_FILE_H
#define CSUM_FILE_H
#include "hash.h"
#include "hash-ll.h"
#include "write-or-die.h"
struct progress;

View File

@ -1,8 +1,9 @@
#include "cache.h"
#include "git-compat-util.h"
#include "abspath.h"
#include "alloc.h"
#include "config.h"
#include "environment.h"
#include "path.h"
#include "pkt-line.h"
#include "protocol.h"
#include "run-command.h"