Git: Fix resolving top level for non-existent sub-sub-directory

When a directory is renamed, and it has sub{sub-}*directories, executing
git blame on a file in the subdirectory -> Blame Revision (or parent) for
the file in the previous name -> Show failed because it couldn't determine
the top level directory.

You can test by opening qmakeprojectmanager/wizards/filespage.cpp and
blaming one of the lines that had it as qt4projectmanager/...

Change-Id: I7ac964c12f1f368c5ce92e9bedd972a2bc824935
Reviewed-by: Tobias Hunger <tobias.hunger@qt.io>
This commit is contained in:
Orgad Shaneh
2018-10-24 16:32:11 +03:00
committed by Orgad Shaneh
parent 9c5afd8e96
commit fe87339888
2 changed files with 15 additions and 13 deletions

View File

@@ -128,7 +128,7 @@ public:
const QStringList &arguments,
bool isRebase = false);
QString findRepositoryForDirectory(const QString &dir) const;
QString findRepositoryForDirectory(const QString &directory) const;
QString findGitDirForRepository(const QString &repositoryDir) const;
bool managesFile(const QString &workingDirectory, const QString &fileName) const;