From 95c2eae395d94a4e8f98b1e894187ecdf58031a4 Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Wed, 23 Nov 2016 13:18:07 +0100 Subject: [PATCH] Fixed issue #2872: Rebase local/remote reversed for tree conflicts Signed-off-by: Sven Strickroth --- src/Changelog.txt | 1 + src/TortoiseProc/AppUtils.cpp | 47 ++++++++++++++++++++++++++++++------------- 2 files changed, 34 insertions(+), 14 deletions(-) diff --git a/src/Changelog.txt b/src/Changelog.txt index 5a88108a2..2304b76be 100644 --- a/src/Changelog.txt +++ b/src/Changelog.txt @@ -39,6 +39,7 @@ Released: unreleased * Fixed issue #2217: LogDlg: Refresh working tree status and file list after changes to working tree * Fixed issue #2833: Pull with 'pull.rebase=preserve' does rebase on invalid upstream * Fixed issue #2859: Cannot clone URLs which contain non-ASCII chars with Git for Windows 2.10.1 and 2.10.2 + * Fixed issue #2872: Rebase local/remote reversed for tree conflicts = Release 2.3.0 = Released: 2016-10-01 diff --git a/src/TortoiseProc/AppUtils.cpp b/src/TortoiseProc/AppUtils.cpp index a3f77fb29..f67b396bc 100644 --- a/src/TortoiseProc/AppUtils.cpp +++ b/src/TortoiseProc/AppUtils.cpp @@ -1852,20 +1852,39 @@ bool CAppUtils::ConflictEdit(const CTGitPath& path, bool bAlternativeTool /*= fa ::DeleteFile(base.GetWinPathString()); CDeleteConflictDlg dlg; - DescribeConflictFile(b_local, b_base,dlg.m_LocalStatus); - DescribeConflictFile(b_remote,b_base,dlg.m_RemoteStatus); - CGitHash localHash, remoteHash; - if (!g_Git.GetHash(localHash, L"HEAD")) - dlg.m_LocalHash = localHash.ToString(); - if (!g_Git.GetHash(remoteHash, L"MERGE_HEAD")) - dlg.m_RemoteHash = remoteHash.ToString(); - else if (!g_Git.GetHash(remoteHash, L"rebase-apply/original-commit")) - dlg.m_RemoteHash = remoteHash.ToString(); - else if (!g_Git.GetHash(remoteHash, L"CHERRY_PICK_HEAD")) - dlg.m_RemoteHash = remoteHash.ToString(); - else if (!g_Git.GetHash(remoteHash, L"REVERT_HEAD")) - dlg.m_RemoteHash = remoteHash.ToString(); - dlg.m_bShowModifiedButton=b_base; + if (!revertTheirMy) + { + DescribeConflictFile(b_local, b_base, dlg.m_LocalStatus); + DescribeConflictFile(b_remote, b_base, dlg.m_RemoteStatus); + CGitHash localHash, remoteHash; + if (!g_Git.GetHash(localHash, L"HEAD")) + dlg.m_LocalHash = localHash.ToString(); + if (!g_Git.GetHash(remoteHash, L"MERGE_HEAD")) + dlg.m_RemoteHash = remoteHash.ToString(); + else if (!g_Git.GetHash(remoteHash, L"rebase-apply/original-commit")) + dlg.m_RemoteHash = remoteHash.ToString(); + else if (!g_Git.GetHash(remoteHash, L"CHERRY_PICK_HEAD")) + dlg.m_RemoteHash = remoteHash.ToString(); + else if (!g_Git.GetHash(remoteHash, L"REVERT_HEAD")) + dlg.m_RemoteHash = remoteHash.ToString(); + } + else + { + DescribeConflictFile(b_local, b_base, dlg.m_RemoteStatus); + DescribeConflictFile(b_remote, b_base, dlg.m_LocalStatus); + CGitHash localHash, remoteHash; + if (!g_Git.GetHash(remoteHash, L"HEAD")) + dlg.m_RemoteHash = remoteHash.ToString(); + if (!g_Git.GetHash(localHash, L"MERGE_HEAD")) + dlg.m_LocalHash = localHash.ToString(); + else if (!g_Git.GetHash(localHash, L"rebase-apply/original-commit")) + dlg.m_LocalHash = localHash.ToString(); + else if (!g_Git.GetHash(localHash, L"CHERRY_PICK_HEAD")) + dlg.m_LocalHash = localHash.ToString(); + else if (!g_Git.GetHash(localHash, L"REVERT_HEAD")) + dlg.m_LocalHash = localHash.ToString(); + } + dlg.m_bShowModifiedButton = b_base; dlg.m_File=merge.GetGitPathString(); if(dlg.DoModal() == IDOK) { -- 2.11.4.GIT