libgit2

git_checkout_options

Version:

Checkout options structure

Zero out for defaults. Initialize with GIT_CHECKOUT_OPTIONS_INIT macro to correctly set the version field. E.g.

git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT;

Signature

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 };

Members

unsigned int
version
unsigned int
checkout_strategy

default will be a dry run

int
disable_filters

don't apply filters like CRLF conversion

unsigned int
dir_mode

default is 0755

unsigned int
file_mode

default is 0644 or 0755 as dictated by blob

int
file_open_flags

default is O_CREAT | O_TRUNC | O_WRONLY

unsigned int
notify_flags
void *
notify_payload
progress_cb

Optional callback to notify the consumer of checkout progress.

void *
progress_payload
paths

When not zeroed out, array of fnmatch patterns specifying which paths should be taken into account, otherwise all files. Use GIT_CHECKOUT_DISABLE_PATHSPEC_MATCH to treat as simple list.

baseline

The expected content of the working directory; defaults to HEAD. If the working directory does not match this baseline information, that will produce a checkout conflict.

baseline_index

expected content of workdir, expressed as an index.

const char *
target_directory

alternative checkout path to workdir

const char *
ancestor_label

the name of the common ancestor side of conflicts

const char *
our_label

the name of the "our" side of conflicts

const char *
their_label

the name of the "their" side of conflicts

perfdata_cb

Optional callback to notify the consumer of performance data.

void *
perfdata_payload

Parameter To

Versions