fix: path may not correct when decide if a file is in repository

This commit is contained in:
Roy Qu 2022-02-25 21:32:48 +08:00
parent fc27be6ae5
commit ad20f8df3f
1 changed files with 4 additions and 1 deletions

View File

@ -1,6 +1,8 @@
#include "gitrepository.h"
#include "gitmanager.h"
#include <QDir>
GitRepository::GitRepository(const QString& folder, QObject *parent)
: QObject{parent},
mInRepository(false)
@ -109,8 +111,9 @@ const QString &GitRepository::realFolder() const
void GitRepository::convertFilesListToSet(const QStringList &filesList, QSet<QString> &set)
{
set.clear();
QDir dir(mRealFolder);
foreach (const QString& s, filesList) {
set.insert(includeTrailingPathDelimiter(mRealFolder)+s);
set.insert(dir.absoluteFilePath(s));
}
}