bool CGitIgnoreList::IsIgnore(CString str, const CString& projectroot, bool isDir) { str.Replace(_T('\\'),_T('/')); if (!str.IsEmpty() && str[str.GetLength() - 1] == _T('/')) str.Truncate(str.GetLength() - 1); int ret; ret = CheckIgnore(str, projectroot, isDir); while (ret < 0) { int start = str.ReverseFind(_T('/')); if(start < 0) return (ret == 1); str.Truncate(start); ret = CheckIgnore(str, projectroot, isDir); } return (ret == 1); }
bool CGitIgnoreList::IsIgnore(const CString &path,const CString &projectroot) { CString str=path; str.Replace(_T('\\'),_T('/')); if (str.GetLength()>0) if (str[str.GetLength()-1] == _T('/')) str = str.Left(str.GetLength() - 1); int ret; ret = CheckIgnore(str, projectroot); while (ret < 0) { int start = str.ReverseFind(_T('/')); if(start < 0) return (ret == 1); str = str.Left(start); ret = CheckIgnore(str, projectroot); } return (ret == 1); }