+\r
+#ifdef _TORTOISESHELL\r
+ if (g_ShellCache.GetCacheType() == ShellCache::dll)\r
+#else\r
+ if ((DWORD)CRegStdWORD(_T("Software\\TortoiseGit\\CacheType"), GetSystemMetrics(SM_REMOTESESSION) ? 2 : 1) == 2)\r
+#endif\r
+ {\r
+ // gitindex.h based status\r
+\r
+ CString sSubPath;\r
+ CString s = path.GetWinPathString();\r
+ if (s.GetLength() > sProjectRoot.GetLength())\r
+ {\r
+ sSubPath = CString(s.Right(s.GetLength() - sProjectRoot.GetLength() - 1/*otherwise it gets initial slash*/));\r
+ }\r
+\r
+ m_status.prop_status = m_status.text_status = git_wc_status_none;\r
+\r
+ m_err = g_IndexFileMap.GetFileStatus(sProjectRoot,sSubPath,&m_status.text_status);\r
+ }\r
+ else\r
+ {\r
+ LPCSTR lpszSubPath = NULL;\r
+ CStringA sSubPath;\r
+ CString s = path.GetWinPathString();\r
+ if (s.GetLength() > sProjectRoot.GetLength())\r
+ {\r
+ sSubPath = CStringA(s.Right(s.GetLength() - sProjectRoot.GetLength() - 1/*otherwise it gets initial slash*/));\r
+ lpszSubPath = sSubPath;\r
+ }\r
+\r
+ // when recursion enabled, let wingit determine the recursive status for folders instead of enumerating all files here\r
+ UINT nFlags = WGEFF_SingleFile | WGEFF_NoRecurse;\r
+ if (!lpszSubPath)\r
+ // report root dir as normal (otherwise it could be considered git_wc_status_unversioned, which would be wrong?)\r
+ nFlags |= WGEFF_EmptyAsNormal;\r
+\r
+ m_status.prop_status = m_status.text_status = git_wc_status_none;\r
+\r
+ // NOTE: currently wgEnumFiles will not enumerate file if it isn't versioned (so status will be git_wc_status_none)\r
+ m_err = !wgEnumFiles(CStringA(sProjectRoot), lpszSubPath, nFlags, &getstatus, &m_status);\r
+\r
+ /*m_err = git_client_status4 (&youngest,\r