From f621ee5bc4aa144e4c907d38762fa7cf72e7a07a Mon Sep 17 00:00:00 2001
From: Orgad Shaneh <orgad.shaneh@audiocodes.com>
Date: Wed, 26 Jun 2013 22:26:29 +0300
Subject: [PATCH] Git: Diff current file against index

Task-number: QTCREATORBUG-9663

Change-Id: I18b4ec5577bf0114075141583c938eaa02d5eded
Reviewed-by: Jarek Kobus <jaroslaw.kobus@digia.com>
---
 src/plugins/git/gitclient.cpp | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)

diff --git a/src/plugins/git/gitclient.cpp b/src/plugins/git/gitclient.cpp
index d8d279ee1d0..4ffe6021d6e 100644
--- a/src/plugins/git/gitclient.cpp
+++ b/src/plugins/git/gitclient.cpp
@@ -118,8 +118,8 @@ public:
 
     // index -> working tree
     void diffFile(const QString &fileName);
-    // stagedFileNames - files in index, diff will compare the state in HEAD to the one in the index
-    // unstagedFileNames - diff will compare the state in the index to the one in the working tree
+    // stagedFileNames:   HEAD -> index
+    // unstagedFileNames: index -> working tree
     void diffFiles(const QStringList &stagedFileNames, const QStringList &unstagedFileNames);
     // index -> working tree
     void diffProjects(const QStringList &projectPaths);
@@ -191,7 +191,7 @@ GitDiffHandler::GitDiffHandler(DiffEditor::DiffEditor *editor,
 void GitDiffHandler::diffFile(const QString &fileName)
 {
     m_requestedRevisionRange = RevisionRange(
-                Revision(Other, QLatin1String(HEAD)),
+                Revision(Index),
                 Revision(WorkingTree));
 
     collectFilesList(QStringList() << QLatin1String("--") << fileName);
@@ -201,7 +201,7 @@ void GitDiffHandler::diffFiles(const QStringList &stagedFileNames, const QString
 {
     RevisionRange stagedRange = RevisionRange(
                 Revision(Other, QLatin1String(HEAD)),
-                Revision(WorkingTree));
+                Revision(Index));
     RevisionRange unstagedRange = RevisionRange(
                 Revision(Index),
                 Revision(WorkingTree));
@@ -219,7 +219,7 @@ void GitDiffHandler::diffFiles(const QStringList &stagedFileNames, const QString
 void GitDiffHandler::diffProjects(const QStringList &projectPaths)
 {
     m_requestedRevisionRange = RevisionRange(
-                Revision(Other, QLatin1String(HEAD)),
+                Revision(Index),
                 Revision(WorkingTree));
 
     collectFilesList(QStringList() << QLatin1String("--") << projectPaths);
@@ -228,7 +228,7 @@ void GitDiffHandler::diffProjects(const QStringList &projectPaths)
 void GitDiffHandler::diffRepository()
 {
     m_requestedRevisionRange = RevisionRange(
-                Revision(Other, QLatin1String(HEAD)),
+                Revision(Index),
                 Revision(WorkingTree));
 
     collectFilesList(QStringList());
-- 
GitLab