From 5cd33c878237a03b9bd96e82adbaddc84aec85b4 Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Sat, 9 Dec 2017 18:30:12 +0100 Subject: [PATCH] Fixed issue #3109: Bad greying out of outer paths (other paths with same prefix also match) Signed-off-by: Sven Strickroth --- src/Changelog.txt | 1 + src/TortoiseProc/LogDlg.cpp | 5 ++++- 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/src/Changelog.txt b/src/Changelog.txt index db569c797..cd8b34c6a 100644 --- a/src/Changelog.txt +++ b/src/Changelog.txt @@ -32,6 +32,7 @@ Released: unreleased * Fixed issue #3041: Commit Window might freeze when clicking on the last modified header shortly after opening * Fixed issue #3061: MenuButton popup might show directly under mouse arrow * Fixed issue #3108: Versioned file in ignored folder causes wrong overlays + * Fixed issue #3109: Bad greying out of outer paths (other paths with same prefix also match) == Known issues == * Issue #3087: Due to changes in Win 10 TortoiseGitMerge might start up slowly or gets slower over time. diff --git a/src/TortoiseProc/LogDlg.cpp b/src/TortoiseProc/LogDlg.cpp index b34fd873e..a76c7584e 100644 --- a/src/TortoiseProc/LogDlg.cpp +++ b/src/TortoiseProc/LogDlg.cpp @@ -915,13 +915,16 @@ void CLogDlg::FillLogMessageCtrl(bool bShow /* = true*/) int count = files.GetCount(); if (!m_bWholeProject && !matchpath.IsEmpty() && m_iHidePaths) { + if (m_path.IsDirectory() && !CStringUtils::EndsWith(matchpath, L'/')) + matchpath.AppendChar(L'/'); int matchPathLen = matchpath.GetLength(); bool somethingHidden = false; for (int i = 0; i < count; ++i) { ((CTGitPath&)files[i]).m_Action &= ~(CTGitPath::LOGACTIONS_HIDE | CTGitPath::LOGACTIONS_GRAY); - if (wcsncmp(files[i].GetGitPathString(), matchpath, matchPathLen) && ((files[i].m_Action & (CTGitPath::LOGACTIONS_REPLACED | CTGitPath::LOGACTIONS_COPY)) == 0 || wcsncmp(files[i].GetGitOldPathString(), matchpath, matchPathLen))) + bool bothAreDirectory = m_path.IsDirectory() && files[i].IsDirectory() && files[i].GetGitPathString().GetLength() == matchPathLen - 1; // submodules don't end with slash, but we must also not match a submodule in a fodler with an equal prefix + if ((bothAreDirectory && wcsncmp(files[i].GetGitPathString(), matchpath, matchPathLen - 1) || !bothAreDirectory && wcsncmp(files[i].GetGitPathString(), matchpath, matchPathLen)) && ((files[i].m_Action & (CTGitPath::LOGACTIONS_REPLACED | CTGitPath::LOGACTIONS_COPY)) == 0 || (bothAreDirectory && wcsncmp(files[i].GetGitOldPathString(), matchpath, matchPathLen - 1) || !bothAreDirectory && wcsncmp(files[i].GetGitOldPathString(), matchpath, matchPathLen)))) { somethingHidden = true; if (m_iHidePaths == 1) -- 2.11.4.GIT