8 struct index_state
*istate
;
11 const char *super_prefix
;
12 struct delayed_checkout
*delayed_checkout
;
13 struct checkout_metadata meta
;
20 #define CHECKOUT_INIT { .base_dir = "" }
22 #define TEMPORARY_FILENAME_LENGTH 25
24 * Write the contents from ce out to the working tree.
26 * When topath[] is not NULL, instead of writing to the working tree
27 * file named by ce, a temporary file is created by this function and
28 * its name is returned in topath[], which must be able to hold at
29 * least TEMPORARY_FILENAME_LENGTH bytes long.
31 * With checkout_entry_ca(), callers can optionally pass a preloaded
32 * conv_attrs struct (to avoid reloading it), when ce refers to a
33 * regular file. If ca is NULL, the attributes will be loaded
34 * internally when (and if) needed.
36 int checkout_entry_ca(struct cache_entry
*ce
, struct conv_attrs
*ca
,
37 const struct checkout
*state
, char *topath
,
39 static inline int checkout_entry(struct cache_entry
*ce
,
40 const struct checkout
*state
, char *topath
,
43 return checkout_entry_ca(ce
, NULL
, state
, topath
, nr_checkouts
);
46 void enable_delayed_checkout(struct checkout
*state
);
47 int finish_delayed_checkout(struct checkout
*state
, int show_progress
);
50 * Unlink the last component and schedule the leading directories for
51 * removal, such that empty directories get removed.
53 * The "super_prefix" is either NULL, or the "--super-prefix" passed
54 * down from "read-tree" et al.
56 void unlink_entry(const struct cache_entry
*ce
, const char *super_prefix
);
58 void *read_blob_entry(const struct cache_entry
*ce
, size_t *size
);
59 int fstat_checkout_output(int fd
, const struct checkout
*state
, struct stat
*st
);
60 void update_ce_after_write(const struct checkout
*state
, struct cache_entry
*ce
,