From eb9e685d5961d3fc0d11741f465f2c3c164e8913 Mon Sep 17 00:00:00 2001 From: Sven Strickroth Date: Thu, 6 Oct 2011 21:41:31 +0200 Subject: [PATCH] Allow to "Update submodules" after pull Signed-off-by: Sven Strickroth --- src/Changelog.txt | 1 + src/TortoiseProc/Commands/PullCommand.cpp | 15 ++++++++++++--- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/src/Changelog.txt b/src/Changelog.txt index d8c3d95cd..60380c861 100644 --- a/src/Changelog.txt +++ b/src/Changelog.txt @@ -4,6 +4,7 @@ * Allow users to be warned if there is no Signed-Off-By line in a commit message * Fixed issue #375: Implement --date/time option gui interface in the commit dialog * Remember last selected commit/line on log filtering + * Allow to "Update submodules" after pull or hard reset == Bug Fix == * Fixed issue #899: Push via Showlog use Push with force option diff --git a/src/TortoiseProc/Commands/PullCommand.cpp b/src/TortoiseProc/Commands/PullCommand.cpp index 0599069b7..8bda8be19 100644 --- a/src/TortoiseProc/Commands/PullCommand.cpp +++ b/src/TortoiseProc/Commands/PullCommand.cpp @@ -30,6 +30,8 @@ #include "AppUtils.h" #include "LogDlg.h" #include "ChangedDlg.h" +#include "AppUtils.h" +#include "PathUtils.h" bool PullCommand::Execute() { @@ -73,6 +75,11 @@ bool PullCommand::Execute() progress.m_GitCmd = cmd; progress.m_PostCmdList.Add(_T("Pulled Diff")); progress.m_PostCmdList.Add(_T("Pulled Log")); + + CTGitPath gitPath = g_Git.m_CurrentDir; + if (gitPath.HasSubmodules()) + progress.m_PostCmdList.Add(_T("Update submodules")); + //progress.m_PostCmdList.Add(_T("Show Conflict")); if (parser.HasVal(_T("closeonend"))) @@ -119,10 +126,12 @@ bool PullCommand::Execute() } - else if ( ret == IDC_PROGRESS_BUTTON1 +2 ) + else if (ret == IDC_PROGRESS_BUTTON1 + 2 && gitPath.HasSubmodules()) { - CChangedDlg dlg; - dlg.DoModal(); + CString sCmd; + sCmd.Format(_T("\"%s\" /command:subupdate /bkpath:\"%s\""), (LPCTSTR)(CPathUtils::GetAppDirectory()+_T("TortoiseProc.exe")), (LPCTSTR)g_Git.m_CurrentDir); + + CAppUtils::LaunchApplication(sCmd, NULL, false); } } #if 0 -- 2.11.4.GIT