]>
git.ipfire.org Git - thirdparty/git.git/blob - entry.h
10 struct index_state
*istate
;
13 const char *super_prefix
;
14 struct delayed_checkout
*delayed_checkout
;
15 struct checkout_metadata meta
;
22 #define CHECKOUT_INIT { .base_dir = "" }
24 #define TEMPORARY_FILENAME_LENGTH 25
26 * Write the contents from ce out to the working tree.
28 * When topath[] is not NULL, instead of writing to the working tree
29 * file named by ce, a temporary file is created by this function and
30 * its name is returned in topath[], which must be able to hold at
31 * least TEMPORARY_FILENAME_LENGTH bytes long.
33 * With checkout_entry_ca(), callers can optionally pass a preloaded
34 * conv_attrs struct (to avoid reloading it), when ce refers to a
35 * regular file. If ca is NULL, the attributes will be loaded
36 * internally when (and if) needed.
38 int checkout_entry_ca(struct cache_entry
*ce
, struct conv_attrs
*ca
,
39 const struct checkout
*state
, char *topath
,
41 static inline int checkout_entry(struct cache_entry
*ce
,
42 const struct checkout
*state
, char *topath
,
45 return checkout_entry_ca(ce
, NULL
, state
, topath
, nr_checkouts
);
48 void enable_delayed_checkout(struct checkout
*state
);
49 int finish_delayed_checkout(struct checkout
*state
, int show_progress
);
52 * Unlink the last component and schedule the leading directories for
53 * removal, such that empty directories get removed.
55 * The "super_prefix" is either NULL, or the "--super-prefix" passed
56 * down from "read-tree" et al.
58 void unlink_entry(const struct cache_entry
*ce
, const char *super_prefix
);
60 void *read_blob_entry(const struct cache_entry
*ce
, size_t *size
);
61 int fstat_checkout_output(int fd
, const struct checkout
*state
, struct stat
*st
);
62 void update_ce_after_write(const struct checkout
*state
, struct cache_entry
*ce
,
66 * Calls the correct function out of {unlink,rmdir}_or_warn based on
67 * the supplied file mode.
69 int remove_or_warn(unsigned int mode
, const char *path
);