forked from qt-creator/qt-creator
Git: Fix reading of gitfile
* QFile ctor does not open the file for read.
* Replace readLine with read(8) to avoid needless read.
This amends commit e9eeaf33b3.
Change-Id: I33c230497ad431091d7d6b271846f5af661b4e0d
Reviewed-by: André Hartmann <aha_1980@gmx.de>
This commit is contained in:
committed by
Orgad Shaneh
parent
d585b85550
commit
681297ad7e
@@ -82,7 +82,10 @@ bool GitVersionControl::isVcsFileOrDirectory(const Utils::FileName &fileName) co
|
|||||||
return false;
|
return false;
|
||||||
if (fileName.toFileInfo().isDir())
|
if (fileName.toFileInfo().isDir())
|
||||||
return true;
|
return true;
|
||||||
return QFile(fileName.toString()).readLine().startsWith("gitdir: ");
|
QFile file(fileName.toString());
|
||||||
|
if (!file.open(QFile::ReadOnly))
|
||||||
|
return false;
|
||||||
|
return file.read(8) == "gitdir: ";
|
||||||
}
|
}
|
||||||
|
|
||||||
bool GitVersionControl::isConfigured() const
|
bool GitVersionControl::isConfigured() const
|
||||||
|
|||||||
Reference in New Issue
Block a user