Git: fix bug with Log and Blame not showing stuff correctly.

Task-number: QTCREATORBUG-9375
Change-Id: I4e18e4c2d4db71392aa305d49ffce924f8451a0b
Reviewed-by: Orgad Shaneh <orgads@gmail.com>
This commit is contained in:
Petar Perisin
2013-06-03 09:00:18 +03:00
committed by Orgad Shaneh
parent f8b052188f
commit 55e087ab05

View File

@@ -1138,6 +1138,8 @@ void GitClient::show(const QString &source, const QString &id,
}
QString title = tr("Git Show \"%1\"").arg(name.isEmpty() ? id : name);
const QFileInfo sourceFi(source);
const QString workDir = sourceFi.isDir() ? sourceFi.absoluteFilePath() : sourceFi.absolutePath();
if (settings()->boolValue(GitSettings::useDiffEditorKey)) {
const Core::Id editorId = DiffEditor::Constants::DIFF_EDITOR_ID;
@@ -1151,7 +1153,9 @@ void GitClient::show(const QString &source, const QString &id,
}
int timeout = settings()->intValue(GitSettings::timeoutKey);
GitDiffHandler *handler = new GitDiffHandler(editorEditable, gitBinaryPath(), source, processEnvironment(), timeout);
GitDiffHandler *handler = new GitDiffHandler(editorEditable, gitBinaryPath(),
findRepositoryForDirectory(workDir),
processEnvironment(), timeout);
handler->show(id);
} else {
const Core::Id editorId = Git::Constants::GIT_DIFF_EDITOR_ID;
@@ -1169,8 +1173,6 @@ void GitClient::show(const QString &source, const QString &id,
arguments.append(userArgs);
arguments << id;
const QFileInfo sourceFi(source);
const QString workDir = sourceFi.isDir() ? sourceFi.absoluteFilePath() : sourceFi.absolutePath();
editor->setDiffBaseDirectory(workDir);
executeGit(workDir, arguments, editor);
}