Git: Do not show diff for all staged files when unstaged requested

For example git rm somefile and modify another, then open the commit
editor and double-click the modified file.

Change-Id: I8c7044b4279192b95dcff4d63f48228ec4960f63
Reviewed-by: Tobias Hunger <tobias.hunger@theqtcompany.com>
This commit is contained in:
Orgad Shaneh
2014-10-27 22:35:03 +02:00
committed by Orgad Shaneh
parent c183386144
commit 27b0fd81a0

View File

@@ -171,11 +171,13 @@ void GitDiffHandler::diffFiles(const QStringList &stagedFileNames,
{
QList<QStringList> arguments;
QStringList stagedArguments;
stagedArguments << QLatin1String("--cached");
stagedArguments << QLatin1String("--");
stagedArguments << stagedFileNames;
arguments << stagedArguments;
if (!stagedFileNames.isEmpty()) {
QStringList stagedArguments;
stagedArguments << QLatin1String("--cached");
stagedArguments << QLatin1String("--");
stagedArguments << stagedFileNames;
arguments << stagedArguments;
}
if (!unstagedFileNames.isEmpty()) {
QStringList unstagedArguments = addHeadWhenCommandInProgress();