From 7cb5b3ddab3c76c1d2672ecdf8eacc98054d9a87 Mon Sep 17 00:00:00 2001 From: Sup Yut Sum Date: Sat, 2 Mar 2013 21:09:45 +0800 Subject: [PATCH] Fixed issue #1667: Ability to ignore a folder in commit dialog Signed-off-by: Sup Yut Sum --- src/Changelog.txt | 1 + src/Git/GitStatusListCtrl.cpp | 18 ++++++++++++++++++ src/Git/GitStatusListCtrl.h | 1 + 3 files changed, 20 insertions(+) diff --git a/src/Changelog.txt b/src/Changelog.txt index 3d3635240..24fb16581 100644 --- a/src/Changelog.txt +++ b/src/Changelog.txt @@ -18,6 +18,7 @@ Released: unreleased * Fixed issue #515: Sort the log window by date * Fixed issue #1676: Automatically check "Make it Bare" when repository path ends in ".git" * Fixed issue #1677: Clicking "revert" on a file should automatically check the file in the revert dialog + * Fixed issue #1667: Ability to ignore a folder in commit dialog == Bug Fixes == * Fixed issue #1642: Incorrect behavior if repo is located on root of drive diff --git a/src/Git/GitStatusListCtrl.cpp b/src/Git/GitStatusListCtrl.cpp index 00d63dbfe..4e6def6e8 100644 --- a/src/Git/GitStatusListCtrl.cpp +++ b/src/Git/GitStatusListCtrl.cpp @@ -1734,6 +1734,8 @@ void CGitStatusListCtrl::OnContextMenuList(CWnd * pWnd, CPoint point) ignoreSubMenu.AppendMenu(MF_STRING | MF_ENABLED, IDGITLC_IGNORE, ignorepath); ignorepath = _T("*")+sExt; ignoreSubMenu.AppendMenu(MF_STRING | MF_ENABLED, IDGITLC_IGNOREMASK, ignorepath); + if (ignorelist.GetCount() == 1) + ignoreSubMenu.AppendMenu(MF_STRING | MF_ENABLED, IDGITLC_IGNOREFOLDER, ignorelist[0].GetContainingDirectory().GetGitPathString()); CString temp; temp.LoadString(IDS_MENUIGNORE); popup.InsertMenu((UINT)-1, MF_BYPOSITION | MF_POPUP, (UINT_PTR)ignoreSubMenu.m_hMenu, temp); @@ -2195,6 +2197,22 @@ void CGitStatusListCtrl::OnContextMenuList(CWnd * pWnd, CPoint point) SetRedraw(TRUE); } break; + case IDGITLC_IGNOREFOLDER: + { + CTGitPathList ignorelist; + ignorelist.AddPath(filepath->GetContainingDirectory()); + SetRedraw(FALSE); + + if (!CAppUtils::IgnoreFile(ignorelist, false)) + break; + + CWnd *pParent = GetLogicalParent(); + if (NULL != pParent && NULL != pParent->GetSafeHwnd()) + pParent->SendMessage(GITSLNM_NEEDSREFRESH); + + SetRedraw(TRUE); + } + break; case IDGITLC_REVERT: { diff --git a/src/Git/GitStatusListCtrl.h b/src/Git/GitStatusListCtrl.h index be23cca9c..ea6f19c66 100644 --- a/src/Git/GitStatusListCtrl.h +++ b/src/Git/GitStatusListCtrl.h @@ -475,6 +475,7 @@ public: IDGITLC_LOGSUBMODULE, IDGITLC_EDITCONFLICT , IDGITLC_IGNOREMASK , + IDGITLC_IGNOREFOLDER , IDGITLC_ADD , IDGITLC_RESOLVECONFLICT , IDGITLC_OPENWITH , -- 2.11.4.GIT