bool DropCopyAddCommand::Execute()\r
{\r
bool bRet = false;\r
-#if 0\r
+\r
CString droppath = parser.GetVal(_T("droptarget"));\r
- if (CTSVNPath(droppath).IsAdminDir())\r
+ if (CTGitPath(droppath).IsAdminDir())\r
+ return FALSE;\r
+\r
+ if(!CTGitPath(droppath).HasAdminDir(&g_Git.m_CurrentDir))\r
return FALSE;\r
\r
- pathList.RemoveAdminPaths();\r
- CTSVNPathList copiedFiles;\r
- for(int nPath = 0; nPath < pathList.GetCount(); nPath++)\r
+ orgPathList.RemoveAdminPaths();\r
+ CTGitPathList copiedFiles;\r
+ for(int nPath = 0; nPath < orgPathList.GetCount(); nPath++)\r
{\r
- if (!pathList[nPath].IsEquivalentTo(CTSVNPath(droppath)))\r
+ if (!orgPathList[nPath].IsEquivalentTo(CTGitPath(droppath)))\r
{\r
//copy the file to the new location\r
- CString name = pathList[nPath].GetFileOrDirectoryName();\r
+ CString name = orgPathList[nPath].GetFileOrDirectoryName();\r
if (::PathFileExists(droppath+_T("\\")+name))\r
{\r
CString strMessage;\r
int ret = CMessageBox::Show(hwndExplorer, strMessage, _T("TortoiseGit"), MB_YESNOCANCEL | MB_ICONQUESTION);\r
if (ret == IDYES)\r
{\r
- if (!::CopyFile(pathList[nPath].GetWinPath(), droppath+_T("\\")+name, FALSE))\r
+ if (!::CopyFile(orgPathList[nPath].GetWinPath(), droppath+_T("\\")+name, FALSE))\r
{\r
//the copy operation failed! Get out of here!\r
LPVOID lpMsgBuf;\r
return FALSE; //cancel the whole operation\r
}\r
}\r
- else if (!CopyFile(pathList[nPath].GetWinPath(), droppath+_T("\\")+name, FALSE))\r
+ else if (!CopyFile(orgPathList[nPath].GetWinPath(), droppath+_T("\\")+name, FALSE))\r
{\r
//the copy operation failed! Get out of here!\r
LPVOID lpMsgBuf;\r
LocalFree( lpMsgBuf );\r
return FALSE;\r
}\r
- copiedFiles.AddPath(CTSVNPath(droppath+_T("\\")+name)); //add the new filepath\r
+ copiedFiles.AddPath(CTGitPath(droppath+_T("\\")+name)); //add the new filepath\r
}\r
}\r
//now add all the newly copied files to the working copy\r
- CSVNProgressDlg progDlg;\r
+ CGitProgressDlg progDlg;\r
theApp.m_pMainWnd = &progDlg;\r
- progDlg.SetCommand(CSVNProgressDlg::SVNProgress_Add);\r
+ progDlg.SetCommand(CGitProgressDlg::GitProgress_Add);\r
if (parser.HasVal(_T("closeonend")))\r
progDlg.SetAutoClose(parser.GetLongVal(_T("closeonend")));\r
progDlg.SetPathList(copiedFiles);\r
progDlg.SetProjectProperties(props);\r
progDlg.DoModal();\r
bRet = !progDlg.DidErrorsOccur();\r
-#endif\r
+\r
return bRet;\r
}\r