| 2800 | } |
| 2801 | |
| 2802 | UINT CGitLogListBase::LogThread() |
| 2803 | { |
| 2804 | ::PostMessage(this->GetParent()->m_hWnd, MSG_LOAD_PERCENTAGE, GITLOG_START, 0); |
| 2805 | |
| 2806 | ULONGLONG t1,t2; |
| 2807 | |
| 2808 | bool shouldWalk = false; |
| 2809 | try |
| 2810 | { |
| 2811 | shouldWalk = (BeginFetchLog() == 0); |
| 2812 | } |
| 2813 | catch (CString& error) |
| 2814 | { |
| 2815 | PostMessage(LVM_SETITEMCOUNT, 0, LVSICF_NOINVALIDATEALL); |
| 2816 | |
| 2817 | CString temp; |
| 2818 | temp.LoadString(IDS_ERR_ERROR); |
| 2819 | temp += L": " + error; |
| 2820 | if (temp.GetLength() >= _countof(m_wszTip)) |
| 2821 | { |
| 2822 | temp.Truncate(_countof(m_wszTip) - 1 - static_cast<int>(wcslen(L"..."))); |
| 2823 | temp += L"..."; |
| 2824 | } |
| 2825 | wcsncpy_s(m_wszTip, temp, _TRUNCATE); |
| 2826 | |
| 2827 | ::PostMessage(this->GetParent()->m_hWnd, MSG_LOAD_PERCENTAGE, GITLOG_FAILED, reinterpret_cast<LPARAM>(m_wszTip)); |
| 2828 | |
| 2829 | InterlockedExchange(&s_bThreadRunning, FALSE); |
| 2830 | InterlockedExchange(&m_bNoDispUpdates, FALSE); |
| 2831 | |
| 2832 | return 1; |
| 2833 | } |
| 2834 | |
| 2835 | // create a copy we can safely work on in this thread |
| 2836 | auto shared_filter{ m_LogFilter.load() }; |
| 2837 | const auto& filter = *shared_filter; |
| 2838 | |
| 2839 | TRACE(L"\n===Begin===\n"); |
| 2840 | //Update work copy item; |
| 2841 | |
| 2842 | if (!m_logEntries.empty()) |
| 2843 | { |
| 2844 | GitRevLoglist* pRev = &m_logEntries.GetGitRevAt(0); |
| 2845 | |
| 2846 | m_arShownList.SafeAdd(pRev); |
| 2847 | } |
| 2848 | |
| 2849 | |
| 2850 | InterlockedExchange(&m_bNoDispUpdates, FALSE); |
| 2851 | |
| 2852 | // store commit number of the last selected commit/line before the refresh or -1 |
| 2853 | int lastSelectedHashNItem = -1; |
| 2854 | const auto lastSelectedHash = m_lastSelectedHash.load(); |
| 2855 | if (lastSelectedHash.IsEmpty()) |
| 2856 | lastSelectedHashNItem = 0; |
| 2857 | |
| 2858 | int ret = 0; |
| 2859 |
no test coverage detected