Git: Use file directory as editor source for files opened inside git dir

* git rev-parse --show-toplevel doesn't work inside git dir.
* Only "Describe (show)" should be available for those files. show
  works when running from inside the git dir

Change-Id: If5f3d1af8da2f8d149ac1e03ffd70b530e609557
Reviewed-by: Petar Perisin <petar.perisin@gmail.com>
Reviewed-by: Tobias Hunger <tobias.hunger@digia.com>
This commit is contained in:
Orgad Shaneh
2013-06-06 09:04:41 +03:00
committed by Orgad Shaneh
parent 879012a50b
commit 96a0920440
3 changed files with 1 additions and 15 deletions

View File

@@ -246,7 +246,7 @@ bool GitEditor::open(QString *errorString, const QString &fileName, const QStrin
if (editorId == Git::Constants::GIT_COMMIT_TEXT_EDITOR_ID
|| editorId == Git::Constants::GIT_REBASE_EDITOR_ID) {
QFileInfo fi(fileName);
setSource(GitPlugin::instance()->gitClient()->findRepositoryForGitDir(fi.absolutePath()));
setSource(fi.absolutePath());
}
return res;
}