| 420 | } |
| 421 | |
| 422 | void 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 | |
| 446 | Commit::Ptr Repository::findMergeBase(const Reference& first, const Reference& second) |
| 447 | { |
no test coverage detected