46 wxLogDebug(
"checkout_progress_cb: %s %zu/%zu",
path, cur, tot );
51 const git_diff_file *baseline,
52 const git_diff_file *target,
53 const git_diff_file *workdir,
void *payload)
57 if( why & ( GIT_CHECKOUT_NOTIFY_CONFLICT | GIT_CHECKOUT_NOTIFY_IGNORED | GIT_CHECKOUT_NOTIFY_UPDATED ) )
65 git_object* head_commit = NULL;
66 git_checkout_options opts = GIT_CHECKOUT_OPTIONS_INIT;
69 if (git_revparse_single(&head_commit,
m_repository,
"HEAD") != 0) {
74 opts.checkout_strategy = GIT_CHECKOUT_FORCE;
88 opts.notify_payload =
static_cast<void*
>(
this);
91 if (git_checkout_tree(
m_repository, head_commit, &opts) != 0)
93 const git_error *e = git_error_last();
96 wxLogError(
"Checkout failed: %d: %s", e->klass, e->message );
106 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)