void CTGitPath::EnsureFwdslashPathSet() const { if(m_sFwdslashPath.IsEmpty()) { SetFwdslashPath(m_sBackslashPath); ATLASSERT(IsEmpty() || !m_sFwdslashPath.IsEmpty()); } }
const CString& CTGitPath::GetGitPathString() const { if(m_sFwdslashPath.IsEmpty()) { SetFwdslashPath(m_sBackslashPath); } return m_sFwdslashPath; }
void CTGitPath::SetFromUnknown(const CString& sPath) { Reset(); // Just set whichever path we think is most likely to be used // GitAdminDir admin; // CString p; // if(admin.HasAdminDir(sPath,&p)) // SetFwdslashPath(sPath.Right(sPath.GetLength()-p.GetLength())); // else SetFwdslashPath(sPath); }
const char* CTSVNPath::GetSVNApiPath(apr_pool_t *pool) const { // This funny-looking 'if' is to avoid a subtle problem with empty paths, whereby // each call to GetSVNApiPath returns a different pointer value. // If you made multiple calls to GetSVNApiPath on the same string, only the last // one would give you a valid pointer to an empty string, because each // call would invalidate the previous call's return. if(IsEmpty()) { return ""; } if(m_sFwdslashPath.IsEmpty()) { SetFwdslashPath(m_sBackslashPath); } if(m_sUTF8FwdslashPath.IsEmpty()) { SetUTF8FwdslashPath(m_sFwdslashPath); } if (svn_path_is_url(m_sUTF8FwdslashPath)) { m_sUTF8FwdslashPathEscaped = CPathUtils::PathEscape(m_sUTF8FwdslashPath); m_sUTF8FwdslashPathEscaped.Replace("file:////", "file://"); m_sUTF8FwdslashPathEscaped = svn_uri_canonicalize(m_sUTF8FwdslashPathEscaped, pool); return m_sUTF8FwdslashPathEscaped; } else { m_sUTF8FwdslashPath = svn_dirent_canonicalize(m_sUTF8FwdslashPath, pool); // for UNC paths that point to the server directly (e.g., \\MYSERVER), not // to a share on the server, the svn_dirent_canonicalize() API returns // a wrong path that asserts when subversion checks that the path is absolute // (it returns /MYSERVER instead of //MYSERVER). // We can't just add the second slash, since that would assert when svn checks // for canonicalized paths. // Since the network server itself isn't interesting anyway but only shares, // we just return an empty path here. if (!svn_dirent_is_absolute(m_sUTF8FwdslashPath)) m_sUTF8FwdslashPath.Empty(); } return m_sUTF8FwdslashPath; }
void CTGitPath::SetFromUnknown(const CString& sPath) { Reset(); SetFwdslashPath(sPath); }
void CTSVNPath::SetFromUnknown(const CString& sPath) { Reset(); // Just set whichever path we think is most likely to be used SetFwdslashPath(sPath); }