52 wxLogTrace(
traceGit, wxS(
"checkout_progress_cb: %s %zu/%zu" ),
path, cur, tot );
57 const git_diff_file *baseline,
58 const git_diff_file *target,
59 const git_diff_file *workdir,
void *payload )
63 if( why & ( GIT_CHECKOUT_NOTIFY_CONFLICT | GIT_CHECKOUT_NOTIFY_IGNORED
64 | GIT_CHECKOUT_NOTIFY_UPDATED ) )
73 git_object* head_commit = NULL;
74 git_checkout_options opts;
75 git_checkout_init_options( &opts, GIT_CHECKOUT_OPTIONS_VERSION );
78 if( git_revparse_single( &head_commit,
m_repository,
"HEAD" ) != 0 )
84 opts.checkout_strategy = GIT_CHECKOUT_FORCE;
98 opts.notify_payload =
static_cast<void*
>( this );
101 if( git_checkout_tree(
m_repository, head_commit, &opts ) != 0 )
103 const git_error *e = git_error_last();
107 wxLogTrace(
traceGit, wxS(
"Checkout failed: %d: %s" ), e->klass, e->message );
117 git_object_free( head_commit );
GIT_REVERT_HANDLER(git_repository *aRepository)
std::vector< wxString > m_filesToRevert
virtual ~GIT_REVERT_HANDLER()
git_repository * m_repository
bool Revert(const wxString &aFilePath)
void PushFailedFile(const wxString &aFilePath)
static int 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)
static void checkout_progress_cb(const char *path, size_t cur, size_t tot, void *payload)
const wxChar *const traceGit
Flag to enable Git debugging output.
wxLogTrace helper definitions.