FileName VCS::checkParentDirs(FileName const & start, std::string const & file)
{
- static FileName empty;
FileName dirname = start.onlyPath();
do {
FileName tocheck = FileName(addPathName(dirname.absFileName(), file));
// this construct because of #8295
dirname = FileName(dirname.absFileName()).parentPath();
} while (!dirname.empty());
- return empty;
+ return FileName();
}
{
LYXERR(Debug::LYXVC, "LyXVC::RCS: retrieve.\n\t" << file);
// The caller ensures that file does not exist, so no need to check that.
- return doVCCommandCall("co -q -r " + quoteName(file.toFilesystemEncoding()),
- FileName()) == 0;
+ int const ret = doVCCommandCall("co -q -r " + quoteName(file.toFilesystemEncoding()));
+ return ret == 0;
}
string const fname = onlyFileName(file.absFileName());
LYXERR(Debug::LYXVC, "LyXVC: Checking if file is under git control for `"
<< fname << '\'');
- int const ret = doVCCommandCall("git log " + quoteName(fname),
+ int const ret = doVCCommandCall("git log -n 0 " + quoteName(fname),
file.onlyPath());
bool const found = (ret == 0);
LYXERR(Debug::LYXVC, "GIT control: " << (found ? "enabled" : "disabled"));