MCPcopy Create free account
hub / github.com/codereader/DarkRadiant / abortMerge

Method abortMerge

plugins/vcs/Repository.cpp:422–444  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

420}
421
422void Repository::abortMerge()
423{
424 if (!mergeIsInProgress())
425 {
426 return;
427 }
428
429 auto head = getHead();
430
431 git_oid targetOid;
432 auto error = git_reference_name_to_id(&targetOid, _repository, head->getName().c_str());
433 GitException::ThrowOnError(error);
434
435 git_object* target;
436 error = git_object_lookup(&target, _repository, &targetOid, GIT_OBJECT_COMMIT);
437 GitException::ThrowOnError(error);
438
439 git_checkout_options checkoutOptions = GIT_CHECKOUT_OPTIONS_INIT;
440 checkoutOptions.checkout_strategy = GIT_CHECKOUT_FORCE;
441
442 error = git_reset(_repository, target, GIT_RESET_HARD, &checkoutOptions);
443 GitException::ThrowOnError(error);
444}
445
446Commit::Ptr Repository::findMergeBase(const Reference& first, const Reference& second)
447{

Callers 1

onMapEventMethod · 0.80

Calls 2

c_strMethod · 0.45
getNameMethod · 0.45

Tested by

no test coverage detected