1 // TortoiseGit - a Windows shell extension for easy version control
3 // External Cache Copyright (C) 2005 - 2006,2010 - Will Dean, Stefan Kueng
4 // Copyright (C) 2008-2014 - TortoiseGit
6 // This program is free software; you can redistribute it and/or
7 // modify it under the terms of the GNU General Public License
8 // as published by the Free Software Foundation; either version 2
9 // of the License, or (at your option) any later version.
11 // This program is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
16 // You should have received a copy of the GNU General Public License
17 // along with this program; if not, write to the Free Software Foundation,
18 // 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
23 #include "TGITCache.h"
24 #include "GitStatusCache.h"
25 #include "CacheInterface.h"
28 #include "CrashReport.h"
29 #include "GitAdminDir.h"
33 #include "..\version.h"
34 #include "SmartHandle.h"
35 #include "DllVersion.h"
38 #define GET_X_LPARAM(lp) ((int)(short)LOWORD(lp))
41 #define GET_Y_LPARAM(lp) ((int)(short)HIWORD(lp))
45 #pragma comment(linker, "\"/manifestdependency:type='win32' name='Microsoft.Windows.Common-Controls' version='6.0.0.0' processorArchitecture='*' publicKeyToken='6595b64144ccf1df' language='*'\"")
47 #if ENABLE_CRASHHANLDER
48 CCrashReportTGit
crasher(L
"TGitCache " _T(APP_X64_STRING
), TGIT_VERMAJOR
, TGIT_VERMINOR
, TGIT_VERMICRO
, TGIT_VERBUILD
, TGIT_VERDATE
);
51 DWORD WINAPI
InstanceThread(LPVOID
);
52 DWORD WINAPI
PipeThread(LPVOID
);
53 DWORD WINAPI
CommandWaitThread(LPVOID
);
54 DWORD WINAPI
CommandThread(LPVOID
);
55 LRESULT CALLBACK
WndProc(HWND
, UINT
, WPARAM
, LPARAM
);
57 NOTIFYICONDATA niData
;
60 TCHAR szCurrentCrawledPath
[MAX_CRAWLEDPATHS
][MAX_CRAWLEDPATHSLEN
];
61 int nCurrentCrawledpathIndex
= 0;
62 CComAutoCriticalSection critSec
;
64 volatile LONG nThreadCount
= 0;
66 #define PACKVERSION(major,minor) MAKELONG(minor,major)
68 void DebugOutputLastError()
72 FORMAT_MESSAGE_ALLOCATE_BUFFER
|
73 FORMAT_MESSAGE_FROM_SYSTEM
|
74 FORMAT_MESSAGE_IGNORE_INSERTS
,
77 MAKELANGID(LANG_NEUTRAL
, SUBLANG_DEFAULT
), // Default language
85 // Display the string.
86 OutputDebugStringA("TGitCache GetLastError(): ");
87 OutputDebugString((LPCTSTR
)lpMsgBuf
);
88 OutputDebugStringA("\n");
91 LocalFree( lpMsgBuf
);
94 int __stdcall
WinMain(HINSTANCE hInstance
, HINSTANCE
/*hPrevInstance*/, LPSTR
/*lpCmdLine*/, int /*cmdShow*/)
97 CAutoGeneralHandle hReloadProtection
= ::CreateMutex(NULL
, FALSE
, GetCacheMutexName());
99 if ((!hReloadProtection
) || (GetLastError() == ERROR_ALREADY_EXISTS
))
101 // An instance of TGitCache is already running
102 CTraceToOutputDebugString::Instance()(__FUNCTION__
": TGitCache ignoring restart\n");
106 CGitStatusCache::Create();
107 CGitStatusCache::Instance().Init();
109 SecureZeroMemory(szCurrentCrawledPath
, sizeof(szCurrentCrawledPath
));
113 TCHAR szWindowClass
[] = {TGIT_CACHE_WINDOW_NAME
};
115 // create a hidden window to receive window messages.
117 wcex
.cbSize
= sizeof(WNDCLASSEX
);
118 wcex
.style
= CS_HREDRAW
| CS_VREDRAW
;
119 wcex
.lpfnWndProc
= (WNDPROC
)WndProc
;
122 wcex
.hInstance
= hInstance
;
125 wcex
.hbrBackground
= 0;
126 wcex
.lpszMenuName
= NULL
;
127 wcex
.lpszClassName
= szWindowClass
;
129 RegisterClassEx(&wcex
);
130 hWnd
= CreateWindow(TGIT_CACHE_WINDOW_NAME
, TGIT_CACHE_WINDOW_NAME
, WS_CAPTION
, 0, 0, 800, 300, NULL
, 0, hInstance
, 0);
136 if (CRegStdDWORD(_T("Software\\TortoiseGit\\CacheTrayIcon"), FALSE
)==TRUE
)
138 SecureZeroMemory(&niData
,sizeof(NOTIFYICONDATA
));
142 GetShellVersion(&dwMajor
, &dwMinor
);
143 DWORD dwVersion
= PACKVERSION(dwMajor
, dwMinor
);
144 if (dwVersion
>= PACKVERSION(6,0))
145 niData
.cbSize
= sizeof(NOTIFYICONDATA
);
146 else if (dwVersion
>= PACKVERSION(5,0))
147 niData
.cbSize
= NOTIFYICONDATA_V2_SIZE
;
149 niData
.cbSize
= NOTIFYICONDATA_V1_SIZE
;
151 niData
.uID
= TRAY_ID
; // own tray icon ID
153 niData
.uFlags
= NIF_ICON
|NIF_MESSAGE
;
157 (HICON
)LoadImage(hInstance
,
158 MAKEINTRESOURCE(IDI_TGITCACHE
),
160 GetSystemMetrics(SM_CXSMICON
),
161 GetSystemMetrics(SM_CYSMICON
),
164 // set the message to send
165 // note: the message value should be in the
166 // range of WM_APP through 0xBFFF
167 niData
.uCallbackMessage
= TRAY_CALLBACK
;
168 Shell_NotifyIcon(NIM_ADD
,&niData
);
170 if(niData
.hIcon
&& DestroyIcon(niData
.hIcon
))
174 // Create a thread which waits for incoming pipe connections
175 CAutoGeneralHandle hPipeThread
= CreateThread(
176 NULL
, // no security attribute
177 0, // default stack size
179 (LPVOID
) &bRun
, // thread parameter
181 &dwThreadId
); // returns thread ID
185 //OutputDebugStringA("TGitCache: Could not create pipe thread\n");
186 //DebugOutputLastError();
189 else hPipeThread
.CloseHandle();
191 // Create a thread which waits for incoming pipe connections
192 CAutoGeneralHandle hCommandWaitThread
= CreateThread(
193 NULL
, // no security attribute
194 0, // default stack size
196 (LPVOID
) &bRun
, // thread parameter
198 &dwThreadId
); // returns thread ID
200 if (!hCommandWaitThread
)
202 //OutputDebugStringA("TGitCache: Could not create command wait thread\n");
203 //DebugOutputLastError();
208 // loop to handle window messages.
211 BOOL bLoopRet
= GetMessage(&msg
, NULL
, 0, 0);
212 if ((bLoopRet
!= -1)&&(bLoopRet
!= 0))
214 DispatchMessage(&msg
);
220 Shell_NotifyIcon(NIM_DELETE
,&niData
);
221 CGitStatusCache::Destroy();
226 LRESULT CALLBACK
WndProc(HWND hWnd
, UINT message
, WPARAM wParam
, LPARAM lParam
)
234 case WM_LBUTTONDBLCLK
:
235 if (IsWindowVisible(hWnd
))
236 ShowWindow(hWnd
, SW_HIDE
);
238 ShowWindow(hWnd
, SW_RESTORE
);
243 NOTIFYICONDATA SystemTray
;
244 sInfoTip
.Format(_T("TortoiseGit Overlay Icon Server\nCached Directories: %Id\nWatched paths: %d"),
245 CGitStatusCache::Instance().GetCacheSize(),
246 CGitStatusCache::Instance().GetNumberOfWatchedPaths());
248 SystemTray
.cbSize
= sizeof(NOTIFYICONDATA
);
249 SystemTray
.hWnd
= hTrayWnd
;
250 SystemTray
.uID
= TRAY_ID
;
251 SystemTray
.uFlags
= NIF_TIP
;
252 _tcscpy_s(SystemTray
.szTip
, sInfoTip
);
253 Shell_NotifyIcon(NIM_MODIFY
, &SystemTray
);
261 HMENU hMenu
= CreatePopupMenu();
264 InsertMenu(hMenu
, (UINT
)-1, MF_BYPOSITION
, TRAYPOP_EXIT
, _T("Exit"));
265 SetForegroundWindow(hWnd
);
266 TrackPopupMenu(hMenu
, TPM_BOTTOMALIGN
, pt
.x
, pt
.y
, 0, hWnd
, NULL
);
277 HDC hdc
= BeginPaint(hWnd
, &ps
);
279 GetClientRect(hWnd
, &rect
);
280 // clear the background
281 HBRUSH background
= CreateSolidBrush(::GetSysColor(COLOR_WINDOW
));
282 HGDIOBJ oldbrush
= SelectObject(hdc
, background
);
283 FillRect(hdc
, &rect
, background
);
287 AutoLocker
print(critSec
);
288 GetTextExtentPoint32( hdc
, szCurrentCrawledPath
[0], (int)_tcslen(szCurrentCrawledPath
[0]), &fontsize
);
289 for (int i
=nCurrentCrawledpathIndex
; i
<MAX_CRAWLEDPATHS
; ++i
)
291 TextOut(hdc
, 0, line
*fontsize
.cy
, szCurrentCrawledPath
[i
], (int)_tcslen(szCurrentCrawledPath
[i
]));
294 for (int i
=0; i
<nCurrentCrawledpathIndex
; ++i
)
296 TextOut(hdc
, 0, line
*fontsize
.cy
, szCurrentCrawledPath
[i
], (int)_tcslen(szCurrentCrawledPath
[i
]));
300 SelectObject(hdc
,oldbrush
);
302 DeleteObject(background
);
308 WORD wmId
= LOWORD(wParam
);
318 case WM_QUERYENDSESSION
:
320 CTraceToOutputDebugString::Instance()(__FUNCTION__
": WM_QUERYENDSESSION\n");
321 CAutoWriteWeakLock
writeLock(CGitStatusCache::Instance().GetGuard(), 200);
322 CGitStatusCache::Instance().Stop();
331 CTraceToOutputDebugString::Instance()(__FUNCTION__
": WM_CLOSE/DESTROY/ENDSESSION/QUIT\n");
332 CAutoWriteLock
writeLock(CGitStatusCache::Instance().GetGuard());
333 CGitStatusCache::Instance().Stop();
334 CGitStatusCache::Instance().SaveCache();
335 if (message
!= WM_QUIT
)
341 case WM_DEVICECHANGE
:
343 DEV_BROADCAST_HDR
* phdr
= (DEV_BROADCAST_HDR
*)lParam
;
346 case DBT_CUSTOMEVENT
:
348 CTraceToOutputDebugString::Instance()(__FUNCTION__
": WM_DEVICECHANGE with DBT_CUSTOMEVENT\n");
349 if (phdr
->dbch_devicetype
== DBT_DEVTYP_HANDLE
)
351 DEV_BROADCAST_HANDLE
* phandle
= (DEV_BROADCAST_HANDLE
*)lParam
;
352 if (IsEqualGUID(phandle
->dbch_eventguid
, GUID_IO_VOLUME_DISMOUNT
))
354 CTraceToOutputDebugString::Instance()(__FUNCTION__
": Device to be dismounted\n");
355 CAutoWriteLock
writeLock(CGitStatusCache::Instance().GetGuard());
356 CGitStatusCache::Instance().CloseWatcherHandles(phandle
->dbch_hdevnotify
);
358 if (IsEqualGUID(phandle
->dbch_eventguid
, GUID_IO_VOLUME_LOCK
))
360 CTraceToOutputDebugString::Instance()(__FUNCTION__
": Device lock event\n");
361 CAutoWriteLock
writeLock(CGitStatusCache::Instance().GetGuard());
362 CGitStatusCache::Instance().CloseWatcherHandles(phandle
->dbch_hdevnotify
);
367 case DBT_DEVICEREMOVEPENDING
:
368 case DBT_DEVICEQUERYREMOVE
:
369 case DBT_DEVICEREMOVECOMPLETE
:
370 CTraceToOutputDebugString::Instance()(__FUNCTION__
": WM_DEVICECHANGE with DBT_DEVICEREMOVEPENDING/DBT_DEVICEQUERYREMOVE/DBT_DEVICEREMOVECOMPLETE\n");
371 // Quit the program immediately as a workaround so the drive is released ASAP
373 if (phdr
->dbch_devicetype
== DBT_DEVTYP_HANDLE
)
375 DEV_BROADCAST_HANDLE
* phandle
= (DEV_BROADCAST_HANDLE
*)lParam
;
376 CAutoWriteLock
writeLock(CGitStatusCache::Instance().GetGuard());
377 CGitStatusCache::Instance().CloseWatcherHandles(phandle
->dbch_handle
);
381 CAutoWriteLock
writeLock(CGitStatusCache::Instance().GetGuard());
382 CGitStatusCache::Instance().CloseWatcherHandles(INVALID_HANDLE_VALUE
);
391 return DefWindowProc(hWnd
, message
, wParam
, lParam
);
394 //////////////////////////////////////////////////////////////////////////
396 VOID
GetAnswerToRequest(const TGITCacheRequest
* pRequest
, TGITCacheResponse
* pReply
, DWORD
* pResponseLength
)
399 *pResponseLength
= 0;
400 if(pRequest
->flags
& TGITCACHE_FLAGS_FOLDERISKNOWN
)
402 path
.SetFromWin(pRequest
->path
, !!(pRequest
->flags
& TGITCACHE_FLAGS_ISFOLDER
));
406 path
.SetFromWin(pRequest
->path
);
409 CAutoReadWeakLock
readLock(CGitStatusCache::Instance().GetGuard(), 2000);
410 if (readLock
.IsAcquired())
412 CGitStatusCache::Instance().GetStatusForPath(path
, pRequest
->flags
, false).BuildCacheResponse(*pReply
, *pResponseLength
);
416 CStatusCacheEntry entry
;
417 entry
.BuildCacheResponse(*pReply
, *pResponseLength
);
421 DWORD WINAPI
PipeThread(LPVOID lpvParam
)
423 CTraceToOutputDebugString::Instance()(__FUNCTION__
": PipeThread started\n");
424 bool * bRun
= (bool *)lpvParam
;
425 // The main loop creates an instance of the named pipe and
426 // then waits for a client to connect to it. When the client
427 // connects, a thread is created to handle communications
428 // with that client, and the loop is repeated.
435 hPipe
= CreateNamedPipe(
437 PIPE_ACCESS_DUPLEX
, // read/write access
438 PIPE_TYPE_MESSAGE
| // message type pipe
439 PIPE_READMODE_MESSAGE
| // message-read mode
440 PIPE_WAIT
, // blocking mode
441 PIPE_UNLIMITED_INSTANCES
, // max. instances
442 BUFSIZE
, // output buffer size
443 BUFSIZE
, // input buffer size
444 NMPWAIT_USE_DEFAULT_WAIT
, // client time-out
449 //OutputDebugStringA("TGitCache: CreatePipe failed\n");
450 //DebugOutputLastError();
453 continue; // never leave the thread!
456 // Wait for the client to connect; if it succeeds,
457 // the function returns a nonzero value. If the function returns
458 // zero, GetLastError returns ERROR_PIPE_CONNECTED.
459 fConnected
= ConnectNamedPipe(hPipe
, NULL
) ? TRUE
: (GetLastError() == ERROR_PIPE_CONNECTED
);
462 // Create a thread for this client.
463 CAutoGeneralHandle hInstanceThread
= CreateThread(
464 NULL
, // no security attribute
465 0, // default stack size
467 (HANDLE
) hPipe
, // thread parameter
469 &dwThreadId
); // returns thread ID
471 if (!hInstanceThread
)
473 //OutputDebugStringA("TGitCache: Could not create Instance thread\n");
474 //DebugOutputLastError();
475 DisconnectNamedPipe(hPipe
);
476 // since we're now closing this thread, we also have to close the whole application!
477 // otherwise the thread is dead, but the app is still running, refusing new instances
478 // but no pipe will be available anymore.
479 PostMessage(hWnd
, WM_CLOSE
, 0, 0);
482 // detach the handle, since we passed it to the thread
487 // The client could not connect, so close the pipe.
488 //OutputDebugStringA("TGitCache: ConnectNamedPipe failed\n");
489 //DebugOutputLastError();
493 continue; // don't end the thread!
496 CTraceToOutputDebugString::Instance()(__FUNCTION__
": Pipe thread exited\n");
500 DWORD WINAPI
CommandWaitThread(LPVOID lpvParam
)
502 CTraceToOutputDebugString::Instance()(__FUNCTION__
": CommandWaitThread started\n");
503 bool * bRun
= (bool *)lpvParam
;
504 // The main loop creates an instance of the named pipe and
505 // then waits for a client to connect to it. When the client
506 // connects, a thread is created to handle communications
507 // with that client, and the loop is repeated.
514 hPipe
= CreateNamedPipe(
515 GetCacheCommandPipeName(),
516 PIPE_ACCESS_DUPLEX
, // read/write access
517 PIPE_TYPE_MESSAGE
| // message type pipe
518 PIPE_READMODE_MESSAGE
| // message-read mode
519 PIPE_WAIT
, // blocking mode
520 PIPE_UNLIMITED_INSTANCES
, // max. instances
521 BUFSIZE
, // output buffer size
522 BUFSIZE
, // input buffer size
523 NMPWAIT_USE_DEFAULT_WAIT
, // client time-out
528 //OutputDebugStringA("TGitCache: CreatePipe failed\n");
529 //DebugOutputLastError();
532 continue; // never leave the thread!
535 // Wait for the client to connect; if it succeeds,
536 // the function returns a nonzero value. If the function returns
537 // zero, GetLastError returns ERROR_PIPE_CONNECTED.
538 fConnected
= ConnectNamedPipe(hPipe
, NULL
) ? TRUE
: (GetLastError() == ERROR_PIPE_CONNECTED
);
541 // Create a thread for this client.
542 CAutoGeneralHandle hCommandThread
= CreateThread(
543 NULL
, // no security attribute
544 0, // default stack size
546 (HANDLE
) hPipe
, // thread parameter
548 &dwThreadId
); // returns thread ID
552 //OutputDebugStringA("TGitCache: Could not create Command thread\n");
553 //DebugOutputLastError();
554 DisconnectNamedPipe(hPipe
);
556 // since we're now closing this thread, we also have to close the whole application!
557 // otherwise the thread is dead, but the app is still running, refusing new instances
558 // but no pipe will be available anymore.
559 PostMessage(hWnd
, WM_CLOSE
, 0, 0);
562 // detach the handle, since we passed it to the thread
567 // The client could not connect, so close the pipe.
568 //OutputDebugStringA("TGitCache: ConnectNamedPipe failed\n");
569 //DebugOutputLastError();
573 continue; // don't end the thread!
576 CTraceToOutputDebugString::Instance()(__FUNCTION__
": CommandWait thread exited\n");
580 DWORD WINAPI
InstanceThread(LPVOID lpvParam
)
582 CTraceToOutputDebugString::Instance()(__FUNCTION__
": InstanceThread started\n");
583 TGITCacheResponse response
;
584 DWORD cbBytesRead
, cbWritten
;
587 // The thread's parameter is a handle to a pipe instance.
590 InterlockedIncrement(&nThreadCount
);
593 // Read client requests from the pipe.
594 TGITCacheRequest request
;
595 BOOL fSuccess
= ReadFile(
596 hPipe
, // handle to pipe
597 &request
, // buffer to receive data
598 sizeof(request
), // size of buffer
599 &cbBytesRead
, // number of bytes read
600 NULL
); // not overlapped I/O
602 if (! fSuccess
|| cbBytesRead
== 0)
604 DisconnectNamedPipe(hPipe
);
605 CTraceToOutputDebugString::Instance()(__FUNCTION__
": Instance thread exited\n");
606 InterlockedDecrement(&nThreadCount
);
607 if (nThreadCount
== 0)
608 PostMessage(hWnd
, WM_CLOSE
, 0, 0);
612 DWORD responseLength
;
613 GetAnswerToRequest(&request
, &response
, &responseLength
);
615 // Write the reply to the pipe.
616 fSuccess
= WriteFile(
617 hPipe
, // handle to pipe
618 &response
, // buffer to write from
619 responseLength
, // number of bytes to write
620 &cbWritten
, // number of bytes written
621 NULL
); // not overlapped I/O
623 if (! fSuccess
|| responseLength
!= cbWritten
)
625 DisconnectNamedPipe(hPipe
);
626 CTraceToOutputDebugString::Instance()(__FUNCTION__
": Instance thread exited\n");
627 InterlockedDecrement(&nThreadCount
);
628 if (nThreadCount
== 0)
629 PostMessage(hWnd
, WM_CLOSE
, 0, 0);
634 // Flush the pipe to allow the client to read the pipe's contents
635 // before disconnecting. Then disconnect the pipe, and close the
636 // handle to this pipe instance.
638 FlushFileBuffers(hPipe
);
639 DisconnectNamedPipe(hPipe
);
640 CTraceToOutputDebugString::Instance()(__FUNCTION__
": Instance thread exited\n");
641 InterlockedDecrement(&nThreadCount
);
642 if (nThreadCount
== 0)
643 PostMessage(hWnd
, WM_CLOSE
, 0, 0);
647 DWORD WINAPI
CommandThread(LPVOID lpvParam
)
649 CTraceToOutputDebugString::Instance()(__FUNCTION__
": CommandThread started\n");
653 // The thread's parameter is a handle to a pipe instance.
659 // Read client requests from the pipe.
660 TGITCacheCommand command
;
661 BOOL fSuccess
= ReadFile(
662 hPipe
, // handle to pipe
663 &command
, // buffer to receive data
664 sizeof(command
), // size of buffer
665 &cbBytesRead
, // number of bytes read
666 NULL
); // not overlapped I/O
668 if (! fSuccess
|| cbBytesRead
== 0)
670 DisconnectNamedPipe(hPipe
);
671 CTraceToOutputDebugString::Instance()(__FUNCTION__
": Command thread exited\n");
675 switch (command
.command
)
677 case TGITCACHECOMMAND_END
:
678 FlushFileBuffers(hPipe
);
679 DisconnectNamedPipe(hPipe
);
680 CTraceToOutputDebugString::Instance()(__FUNCTION__
": Command thread exited\n");
682 case TGITCACHECOMMAND_CRAWL
:
684 CTGitPath changedpath
;
685 changedpath
.SetFromWin(command
.path
, true);
686 // remove the path from our cache - that will 'invalidate' it.
688 CAutoWriteLock
writeLock(CGitStatusCache::Instance().GetGuard());
689 CGitStatusCache::Instance().RemoveCacheForPath(changedpath
);
691 CGitStatusCache::Instance().AddFolderForCrawling(changedpath
.GetDirectory());
694 case TGITCACHECOMMAND_REFRESHALL
:
696 CAutoWriteLock
writeLock(CGitStatusCache::Instance().GetGuard());
697 CTraceToOutputDebugString::Instance()(_T(__FUNCTION__
) _T(": refresh all\n"));
698 CGitStatusCache::Instance().Refresh();
701 case TGITCACHECOMMAND_RELEASE
:
703 CTGitPath changedpath
;
704 changedpath
.SetFromWin(command
.path
, true);
705 CTraceToOutputDebugString::Instance()(_T(__FUNCTION__
) _T(": release handle for path %s\n"), changedpath
.GetWinPath());
706 CAutoWriteLock
writeLock(CGitStatusCache::Instance().GetGuard());
707 CGitStatusCache::Instance().CloseWatcherHandles(changedpath
);
708 CGitStatusCache::Instance().RemoveCacheForPath(changedpath
);
711 case TGITCACHECOMMAND_BLOCK
:
713 CTGitPath changedpath
;
714 changedpath
.SetFromWin(command
.path
);
715 CTraceToOutputDebugString::Instance()(_T(__FUNCTION__
) _T(": block path %s\n"), changedpath
.GetWinPath());
716 CGitStatusCache::Instance().BlockPath(changedpath
);
719 case TGITCACHECOMMAND_UNBLOCK
:
721 CTGitPath changedpath
;
722 changedpath
.SetFromWin(command
.path
);
723 CTraceToOutputDebugString::Instance()(_T(__FUNCTION__
) _T(": unblock path %s\n"), changedpath
.GetWinPath());
724 CGitStatusCache::Instance().UnBlockPath(changedpath
);
730 // Flush the pipe to allow the client to read the pipe's contents
731 // before disconnecting. Then disconnect the pipe, and close the
732 // handle to this pipe instance.
734 FlushFileBuffers(hPipe
);
735 DisconnectNamedPipe(hPipe
);
736 CTraceToOutputDebugString::Instance()(__FUNCTION__
": Command thread exited\n");