Now LyX correctly asks to retrieve non-existing file from GIT repo only if the file is actually registered in repo.

See also discussion at: http://www.mail-archive.com/lyx-devel@lists.lyx.org/msg177840.html
This commit is contained in:
Tommaso Cucinotta 2013-04-06 16:12:06 +01:00
parent 8e5a020c0c
commit 26dd4d0c15

View File

@ -1844,15 +1844,20 @@ FileName const GIT::findFile(FileName const & file)
file.onlyPath());
if (found)
{
// The output is empty for file names NOT in repo.
// The output contains a line starting with "??" for unknown
// files, no line for known unmodified files and a line
// starting with "M" or something else for modified/deleted
// etc. files.
ifstream ifs(tmpf.toFilesystemEncoding().c_str());
string test;
if ((ifs >> test))
found = (test != "??");
// else is no error
if (tmpf.isFileEmpty())
found = false;
else {
ifstream ifs(tmpf.toFilesystemEncoding().c_str());
string test;
if ((ifs >> test))
found = (test != "??");
// else is no error
}
}
tmpf.removeFile();
LYXERR(Debug::LYXVC, "GIT control: " << (found ? "enabled" : "disabled"));