| 437 | } |
| 438 | |
| 439 | void VcsStatus::performMapFileStatusCheck(std::shared_ptr<git::Repository> repository) |
| 440 | { |
| 441 | try |
| 442 | { |
| 443 | auto relativePath = repository->getRepositoryRelativePath(GlobalMapModule().getMapName()); |
| 444 | |
| 445 | if (relativePath.empty()) |
| 446 | { |
| 447 | setMapFileStatus(_("Map not in VCS")); |
| 448 | return; |
| 449 | } |
| 450 | |
| 451 | if (repository->fileHasUncommittedChanges(relativePath)) |
| 452 | { |
| 453 | setMapFileStatus(_("Map saved, pending commit")); |
| 454 | } |
| 455 | else if (repository->fileIsIndexed(relativePath)) |
| 456 | { |
| 457 | setMapFileStatus(_("Map committed")); |
| 458 | } |
| 459 | else |
| 460 | { |
| 461 | setMapFileStatus(_("Map saved")); |
| 462 | } |
| 463 | } |
| 464 | catch (const git::GitException& ex) |
| 465 | { |
| 466 | setMapFileStatus(std::string("ERROR: ") + ex.what()); |
| 467 | } |
| 468 | } |
| 469 | |
| 470 | } |
| 471 |
nothing calls this directly
no test coverage detected