\r
LPCSTR lpszSubPath = NULL;\r
CStringA sSubPath;\r
- CString s = path.GetDirectory().GetWinPathString();\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
\r
LPCSTR lpszSubPath = NULL;\r
CStringA sSubPath;\r
- CString s = path.GetDirectory().GetWinPathString();\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
\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
\r
\r
// Error present if function is not under version control\r
- if ((m_err != NULL) || /*(apr_hash_count(statushash) == 0)*/m_status.prop_status == git_wc_status_none)\r
+ if ((m_err != NULL) /*|| (apr_hash_count(statushash) == 0)*/)\r
{\r
status = NULL;\r
// return -2; \r
fetchedstatus = status;\r
//if ((stat.status->entry)&&(stat.status->entry->lock_token))\r
// itemStates |= (stat.status->entry->lock_token[0] != 0) ? ITEMIS_LOCKED : 0;\r
- //if ((stat.status->entry)&&(stat.status->entry->kind == git_node_dir))\r
- //{\r
- // itemStates |= ITEMIS_FOLDER;\r
- // if ((status != git_wc_status_unversioned)&&(status != git_wc_status_ignored)&&(status != git_wc_status_none))\r
- // itemStates |= ITEMIS_FOLDERINGit;\r
- //}\r
+ if ( askedpath.IsDirectory() )//if ((stat.status->entry)&&(stat.status->entry->kind == git_node_dir))\r
+ {\r
+ itemStates |= ITEMIS_FOLDER;\r
+ if ((status != git_wc_status_unversioned)&&(status != git_wc_status_ignored)&&(status != git_wc_status_none))\r
+ itemStates |= ITEMIS_FOLDERINSVN;\r
+ }\r
//if ((stat.status->entry)&&(stat.status->entry->present_props))\r
//{\r
// if (strstr(stat.status->entry->present_props, "svn:needs-lock"))\r
fetchedstatus = status;\r
//if ((stat.status->entry)&&(stat.status->entry->lock_token))\r
// itemStates |= (stat.status->entry->lock_token[0] != 0) ? ITEMIS_LOCKED : 0;\r
- //if ((stat.status->entry)&&(stat.status->entry->kind == git_node_dir))\r
- //{\r
- // itemStates |= ITEMIS_FOLDER;\r
- // if ((status != git_wc_status_unversioned)&&(status != git_wc_status_ignored)&&(status != git_wc_status_none))\r
- // itemStates |= ITEMIS_FOLDERINGit;\r
- //}\r
- //if ((stat.status->entry)&&(stat.status->entry->conflict_wrk))\r
- // itemStates |= ITEMIS_CONFLICTED;\r
+ if ( strpath.IsDirectory() )//if ((stat.status->entry)&&(stat.status->entry->kind == git_node_dir))\r
+ {\r
+ itemStates |= ITEMIS_FOLDER;\r
+ if ((status != git_wc_status_unversioned)&&(status != git_wc_status_ignored)&&(status != git_wc_status_none))\r
+ itemStates |= ITEMIS_FOLDERINSVN;\r
+ }\r
+ // TODO: do we need to check that it's not a dir? does conflict options makes sense for dir in git?\r
+ if (status == git_wc_status_conflicted)//if ((stat.status->entry)&&(stat.status->entry->conflict_wrk))\r
+ itemStates |= ITEMIS_CONFLICTED;\r
//if ((stat.status->entry)&&(stat.status->entry->present_props))\r
//{\r
// if (strstr(stat.status->entry->present_props, "svn:needs-lock"))\r
}\r
} // for (int i = 0; i < count; ++i)\r
ItemIDList child (GetPIDLItem (cida, 0), &parent);\r
-// ? was this disabled because the /wc option does not work safely with Git? or because the code below didn't compile before?\r
-// if (g_ShellCache.HasSVNAdminDir(child.toString().c_str(), FALSE))\r
-// itemStates |= ITEMIS_INVERSIONEDFOLDER;\r
+ if (g_ShellCache.HasSVNAdminDir(child.toString().c_str(), FALSE))\r
+ itemStates |= ITEMIS_INVERSIONEDFOLDER;\r
GlobalUnlock(medium.hGlobal);\r
\r
// if the item is a versioned folder, check if there's a patch file\r
int menuIndex = 0;\r
bool bAddSeparator = false;\r
bool bMenuEntryAdded = false;\r
+ bool bMenuEmpty = true;\r
// insert separator at start\r
InsertMenu(hMenu, indexMenu++, MF_SEPARATOR|MF_BYPOSITION, 0, NULL); idCmd++;\r
bool bShowIcons = !!DWORD(CRegStdWORD(_T("Software\\TortoiseGit\\ShowContextMenuIcons"), TRUE));\r
- if (fullver <= 0x0500)\r
+ // ?? TortoiseSVN had this as (fullver <= 0x0500) this disabled icons in win2k, but icons work fine in win2k\r
+ if (fullver < 0x0500)\r
bShowIcons = false;\r
while (menuInfo[menuIndex].command != ShellMenuLastEntry)\r
{\r
// another 'normal' menu entry after we insert a separator.\r
// we simply set a flag here, indicating that before the next\r
// 'normal' menu entry, a separator should be added.\r
- bAddSeparator = true;\r
+ if (!bMenuEmpty)\r
+ bAddSeparator = true;\r
}\r
else\r
{\r
{\r
InsertIgnoreSubmenus(idCmd, idCmdFirst, hMenu, subMenu, indexMenu, indexSubMenu, topmenu, bShowIcons);\r
bMenuEntryAdded = true;\r
+ bMenuEmpty = false;\r
}\r
else\r
{\r
menuInfo[menuIndex].command,\r
uFlags);\r
if (!bIsTop)\r
+ {\r
bMenuEntryAdded = true;\r
+ bMenuEmpty = false;\r
+ }\r
}\r
}\r
}\r