Check if repository is corrupted: do not check for etc/ or
opt/-directories, as they may be not existent inside of the repository.
This commit is contained in:
parent
721c5dd7a5
commit
003bd0bf77
18
worker.cpp
18
worker.cpp
@ -215,17 +215,17 @@ void Worker::update() {
|
||||
bool Worker::isRepositoryCorrupted() {
|
||||
QDir customerRepository(m_customerRepository);
|
||||
if (customerRepository.exists()) {
|
||||
QDir customerRepositoryEtc(QDir::cleanPath(m_customerRepository + QDir::separator() + "etc/"));
|
||||
QDir customerRepositoryOpt(QDir::cleanPath(m_customerRepository + QDir::separator() + "opt/"));
|
||||
QDir customerRepositoryGit(QDir::cleanPath(m_customerRepository + QDir::separator() + ".git/"));
|
||||
if (!m_gc.gitFsck()
|
||||
// etc-directory inside git-repository does not exist, which means the
|
||||
// git-repository is corrupted -> remove it and start from scratch
|
||||
|| !customerRepositoryEtc.exists()
|
||||
|| !customerRepositoryGit.exists()
|
||||
|| !customerRepositoryOpt.exists()) {
|
||||
if (!m_gc.gitFsck()) {
|
||||
// should never happen
|
||||
Utils::printCriticalErrorMsg("CORRUPTED CUSTOMER REPOSITORY");
|
||||
Utils::printCriticalErrorMsg("CORRUPTED CUSTOMER REPOSITORY: GIT_FSCK FAILED");
|
||||
return true;
|
||||
}
|
||||
// .git-directory inside git-repository does not exist, which means the
|
||||
// git-repository is corrupted -> remove it and start from scratch
|
||||
if (!customerRepositoryGit.exists()) {
|
||||
// should never happen
|
||||
Utils::printCriticalErrorMsg("CORRUPTED CUSTOMER REPOSITORY .GIT DOES NOT EXIST");
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user