From e8e1f94cf7d2394d8825c3ea549a0efa3f5bee58 Mon Sep 17 00:00:00 2001 From: Sup Yut Sum Date: Tue, 5 Aug 2014 00:16:00 +0800 Subject: [PATCH] Fix crash when clicking merge after switch Fix regression of 4bb67cdf35c373a8b7007a6fed9b64e04b8e57e4 Signed-off-by: Sup Yut Sum --- src/TortoiseProc/AppUtils.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/TortoiseProc/AppUtils.cpp b/src/TortoiseProc/AppUtils.cpp index 844d47725..fe5fc2d7f 100644 --- a/src/TortoiseProc/AppUtils.cpp +++ b/src/TortoiseProc/AppUtils.cpp @@ -1167,6 +1167,8 @@ bool CAppUtils::PerformSwitch(CString ref, bool bForce /* false */, CString sNew CProgressDlg progress; progress.m_GitCmd = cmd; + CString currentBranch; + bool hasBranch = CGit::GetCurrentBranchFromFile(g_Git.m_CurrentDir, currentBranch) == 0; progress.m_PostCmdCallback = [&](DWORD status, PostCmdList& postCmdList) { if (!status) @@ -1181,8 +1183,6 @@ bool CAppUtils::PerformSwitch(CString ref, bool bForce /* false */, CString sNew RunTortoiseGitProc(sCmd); })); } - CString currentBranch; - bool hasBranch = CGit::GetCurrentBranchFromFile(g_Git.m_CurrentDir, currentBranch) == 0; if (hasBranch) postCmdList.push_back(PostCmd(IDI_MERGE, IDS_MENUMERGE, [&]{ Merge(¤tBranch); })); -- 2.11.4.GIT