1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87
|
typedef enum {
GIT_CHECKOUT_NOTIFY_NONE = 0,
GIT_CHECKOUT_NOTIFY_CONFLICT = 1,
GIT_CHECKOUT_NOTIFY_DIRTY = 2,
GIT_CHECKOUT_NOTIFY_UPDATED = 4,
GIT_CHECKOUT_NOTIFY_UNTRACKED = 8,
GIT_CHECKOUT_NOTIFY_IGNORED = 16,
GIT_CHECKOUT_NOTIFY_ALL = 0x0FFFF
} git_checkout_notify_t;
typedef int (*git_checkout_notify_cb)(
git_checkout_notify_t why,
const char *path,
const git_diff_file *baseline,
const git_diff_file *target,
const git_diff_file *workdir,
void *payload);
typedef void (*git_checkout_progress_cb)(
const char *path,
size_t completed_steps,
size_t total_steps,
void *payload);
typedef struct {
size_t mkdir_calls;
size_t stat_calls;
size_t chmod_calls;
} git_checkout_perfdata;
typedef void (*git_checkout_perfdata_cb)(
const git_checkout_perfdata *perfdata,
void *payload);
typedef struct git_checkout_options {
unsigned int version;
unsigned int checkout_strategy;
int disable_filters;
unsigned int dir_mode;
unsigned int file_mode;
int file_open_flags;
unsigned int notify_flags;
git_checkout_notify_cb notify_cb;
void *notify_payload;
git_checkout_progress_cb progress_cb;
void *progress_payload;
git_strarray paths;
git_tree *baseline;
git_index *baseline_index;
const char *target_directory;
const char *ancestor_label;
const char *our_label;
const char *their_label;
git_checkout_perfdata_cb perfdata_cb;
void *perfdata_payload;
} git_checkout_options;
int git_checkout_options_init(
git_checkout_options *opts,
unsigned int version);
int git_checkout_tree(
git_repository *repo,
const git_object *treeish,
const git_checkout_options *opts);
int git_checkout_head(
git_repository *repo,
const git_checkout_options *opts);
int git_checkout_index(
git_repository *repo,
git_index *index,
const git_checkout_options *opts);
|