MCPcopy Create free account
hub / github.com/KDE/kdevelop / dotGitDirectory

Function dotGitDirectory

plugins/git/gitplugin.cpp:78–91  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

76{
77
78QDir dotGitDirectory(const QUrl& dirPath, bool silent = false)
79{
80 const QFileInfo finfo(dirPath.toLocalFile());
81 QDir dir = finfo.isDir() ? QDir(finfo.filePath()): finfo.absoluteDir();
82
83 const QString gitDir = QStringLiteral(".git");
84 while (!dir.exists(gitDir) && dir.cdUp()) {} // cdUp, until there is a sub-directory called .git
85
86 if (!silent && dir.isRoot()) {
87 qCWarning(PLUGIN_GIT) << "couldn't find the git root for" << dirPath;
88 }
89
90 return dir;
91}
92
93[[nodiscard]] QString gitHeadFile(const QUrl& dirPath)
94{

Callers 15

gitHeadFileFunction · 0.85
repositoryRootMethod · 0.85
isValidDirectoryMethod · 0.85
addMethod · 0.85
diffMethod · 0.85
resetMethod · 0.85
applyMethod · 0.85
revertMethod · 0.85
commitMethod · 0.85
commitStagedMethod · 0.85
removeMethod · 0.85
logMethod · 0.85

Calls 5

toLocalFileMethod · 0.80
absoluteDirMethod · 0.80
existsMethod · 0.80
QDirClass · 0.70
filePathMethod · 0.45

Tested by

no test coverage detected