Commit f621ee5b authored by Orgad Shaneh's avatar Orgad Shaneh Committed by Orgad Shaneh

Git: Diff current file against index

Task-number: QTCREATORBUG-9663

Change-Id: I18b4ec5577bf0114075141583c938eaa02d5eded
Reviewed-by: default avatarJarek Kobus <jaroslaw.kobus@digia.com>
parent 893b1e9a
...@@ -118,8 +118,8 @@ public: ...@@ -118,8 +118,8 @@ public:
// index -> working tree // index -> working tree
void diffFile(const QString &fileName); void diffFile(const QString &fileName);
// stagedFileNames - files in index, diff will compare the state in HEAD to the one in the index // stagedFileNames: HEAD -> index
// unstagedFileNames - diff will compare the state in the index to the one in the working tree // unstagedFileNames: index -> working tree
void diffFiles(const QStringList &stagedFileNames, const QStringList &unstagedFileNames); void diffFiles(const QStringList &stagedFileNames, const QStringList &unstagedFileNames);
// index -> working tree // index -> working tree
void diffProjects(const QStringList &projectPaths); void diffProjects(const QStringList &projectPaths);
...@@ -191,7 +191,7 @@ GitDiffHandler::GitDiffHandler(DiffEditor::DiffEditor *editor, ...@@ -191,7 +191,7 @@ GitDiffHandler::GitDiffHandler(DiffEditor::DiffEditor *editor,
void GitDiffHandler::diffFile(const QString &fileName) void GitDiffHandler::diffFile(const QString &fileName)
{ {
m_requestedRevisionRange = RevisionRange( m_requestedRevisionRange = RevisionRange(
Revision(Other, QLatin1String(HEAD)), Revision(Index),
Revision(WorkingTree)); Revision(WorkingTree));
collectFilesList(QStringList() << QLatin1String("--") << fileName); collectFilesList(QStringList() << QLatin1String("--") << fileName);
...@@ -201,7 +201,7 @@ void GitDiffHandler::diffFiles(const QStringList &stagedFileNames, const QString ...@@ -201,7 +201,7 @@ void GitDiffHandler::diffFiles(const QStringList &stagedFileNames, const QString
{ {
RevisionRange stagedRange = RevisionRange( RevisionRange stagedRange = RevisionRange(
Revision(Other, QLatin1String(HEAD)), Revision(Other, QLatin1String(HEAD)),
Revision(WorkingTree)); Revision(Index));
RevisionRange unstagedRange = RevisionRange( RevisionRange unstagedRange = RevisionRange(
Revision(Index), Revision(Index),
Revision(WorkingTree)); Revision(WorkingTree));
...@@ -219,7 +219,7 @@ void GitDiffHandler::diffFiles(const QStringList &stagedFileNames, const QString ...@@ -219,7 +219,7 @@ void GitDiffHandler::diffFiles(const QStringList &stagedFileNames, const QString
void GitDiffHandler::diffProjects(const QStringList &projectPaths) void GitDiffHandler::diffProjects(const QStringList &projectPaths)
{ {
m_requestedRevisionRange = RevisionRange( m_requestedRevisionRange = RevisionRange(
Revision(Other, QLatin1String(HEAD)), Revision(Index),
Revision(WorkingTree)); Revision(WorkingTree));
collectFilesList(QStringList() << QLatin1String("--") << projectPaths); collectFilesList(QStringList() << QLatin1String("--") << projectPaths);
...@@ -228,7 +228,7 @@ void GitDiffHandler::diffProjects(const QStringList &projectPaths) ...@@ -228,7 +228,7 @@ void GitDiffHandler::diffProjects(const QStringList &projectPaths)
void GitDiffHandler::diffRepository() void GitDiffHandler::diffRepository()
{ {
m_requestedRevisionRange = RevisionRange( m_requestedRevisionRange = RevisionRange(
Revision(Other, QLatin1String(HEAD)), Revision(Index),
Revision(WorkingTree)); Revision(WorkingTree));
collectFilesList(QStringList()); collectFilesList(QStringList());
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment