From 991a695c1407be101d5e97b88e4f9c87385c850f Mon Sep 17 00:00:00 2001 From: Sup Yut Sum Date: Sun, 27 Jan 2013 12:34:29 +0800 Subject: [PATCH] Reduce local variables in CAppUtils::Merge method Signed-off-by: Sup Yut Sum --- src/TortoiseProc/AppUtils.cpp | 22 +++++++--------------- 1 file changed, 7 insertions(+), 15 deletions(-) diff --git a/src/TortoiseProc/AppUtils.cpp b/src/TortoiseProc/AppUtils.cpp index f85bdac97..332432fe2 100644 --- a/src/TortoiseProc/AppUtils.cpp +++ b/src/TortoiseProc/AppUtils.cpp @@ -2702,32 +2702,24 @@ BOOL CAppUtils::Merge(CString *commit) if(dlg.DoModal()==IDOK) { CString cmd; - CString noff; - CString squash; - CString nocommit; - CString msg; + CString args; if(dlg.m_bNoFF) - noff=_T("--no-ff"); + args += _T(" --no-ff"); if(dlg.m_bSquash) - squash=_T("--squash"); + args += _T(" --squash"); if(dlg.m_bNoCommit) - nocommit=_T("--no-commit"); + args += _T(" --no-commit"); if(!dlg.m_strLogMesage.IsEmpty()) { CString logmsg = dlg.m_strLogMesage; logmsg.Replace(_T("\""), _T("\\\"")); - msg += _T("-m \"") + logmsg + _T("\""); - } - cmd.Format(_T("git.exe merge %s %s %s %s %s"), - msg, - noff, - squash, - nocommit, - g_Git.FixBranchName(dlg.m_VersionName)); + args += _T(" -m \"") + logmsg + _T("\""); + } + cmd.Format(_T("git.exe merge %s %s"), args, g_Git.FixBranchName(dlg.m_VersionName)); CProgressDlg Prodlg; Prodlg.m_GitCmd = cmd; -- 2.11.4.GIT