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

Method performMapFileStatusCheck

plugins/vcs/ui/VcsStatus.cpp:439–468  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

437}
438
439void 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

Callers

nothing calls this directly

Calls 7

fileIsIndexedMethod · 0.80
whatMethod · 0.80
_Function · 0.50
getMapNameMethod · 0.45
emptyMethod · 0.45

Tested by

no test coverage detected