OSDN Git Service

Merge branch 'master' of git://repo.or.cz/TortoiseGit
[tortoisegit/TortoiseGitJp.git] / src / TGitCache / CachedDirectory.cpp
index ed81ef3..6460789 100644 (file)
@@ -404,17 +404,17 @@ CStatusCacheEntry CCachedDirectory::GetStatusForMember(const CTGitPath& path, bo
                        m_directoryPath.HasAdminDir(&sProjectRoot);\r
                        ATLASSERT( !m_directoryPath.IsEmpty() );\r
 \r
-                       LPCSTR lpszSubPath = NULL;\r
-                       CStringA sSubPath;\r
+                       LPCTSTR lpszSubPath = NULL;\r
+                       CString sSubPath;\r
                        CString s = m_directoryPath.GetDirectory().GetWinPathString();\r
                        if (s.GetLength() > sProjectRoot.GetLength())\r
                        {\r
-                               sSubPath = CStringA(s.Right(s.GetLength() - sProjectRoot.GetLength() - 1/*otherwise it gets initial slash*/));\r
+                               sSubPath = s.Right(s.GetLength() - sProjectRoot.GetLength() - 1/*otherwise it gets initial slash*/);\r
                                lpszSubPath = sSubPath;\r
                        }\r
 //MessageBoxA(NULL, CStringA(sProjectRoot), sSubPath, MB_OK);\r
 //OutputDebugStringA("###");OutputDebugStringW(sProjectRoot);OutputDebugStringA(" - ");OutputDebugStringA(sSubPath);OutputDebugStringA("\r\n");\r
-                       BOOL pErr = !wgEnumFiles(CStringA(sProjectRoot), lpszSubPath, WGEFF_NoRecurse|WGEFF_FullPath, &GetStatusCallback, this);\r
+                       BOOL pErr = !wgEnumFiles(sProjectRoot, lpszSubPath, WGEFF_NoRecurse|WGEFF_FullPath, &GetStatusCallback, this);\r
 \r
                        /*git_error_t* pErr = svn_client_status4 (\r
                                NULL,\r
@@ -853,11 +853,13 @@ git_wc_status_kind CCachedDirectory::CalculateRecursiveStatus()
        // Combine our OWN folder status with the most important of our *FILES'* status.\r
        git_wc_status_kind retVal = GitStatus::GetMoreImportant(m_mostImportantFileStatus, m_ownStatus.GetEffectiveStatus());\r
 \r
-       if ((retVal != git_wc_status_modified)&&(retVal != m_ownStatus.GetEffectiveStatus()))\r
+       // NOTE: TSVN marks dir as modified if it contains added/deleted/missing files, but we prefer the most important\r
+       //       status to propagate upward in its original state\r
+       /*if ((retVal != git_wc_status_modified)&&(retVal != m_ownStatus.GetEffectiveStatus()))\r
        {\r
                if ((retVal == git_wc_status_added)||(retVal == git_wc_status_deleted)||(retVal == git_wc_status_missing))\r
                        retVal = git_wc_status_modified;\r
-       }\r
+       }*/\r
 \r
        // Now combine all our child-directorie's status\r
        \r
@@ -866,11 +868,11 @@ git_wc_status_kind CCachedDirectory::CalculateRecursiveStatus()
        for(it = m_childDirectories.begin(); it != m_childDirectories.end(); ++it)\r
        {\r
                retVal = GitStatus::GetMoreImportant(retVal, it->second);\r
-               if ((retVal != git_wc_status_modified)&&(retVal != m_ownStatus.GetEffectiveStatus()))\r
+               /*if ((retVal != git_wc_status_modified)&&(retVal != m_ownStatus.GetEffectiveStatus()))\r
                {\r
                        if ((retVal == git_wc_status_added)||(retVal == git_wc_status_deleted)||(retVal == git_wc_status_missing))\r
                                retVal = git_wc_status_modified;\r
-               }\r
+               }*/\r
        }\r
        \r
        return retVal;\r