Skip to content

Commit 0c662a7

Browse files
committed
Remving local repository uses now wxRmdir().
1 parent 5e80229 commit 0c662a7

File tree

1 file changed

+7
-10
lines changed

1 file changed

+7
-10
lines changed

src/GitBlocks.cpp

Lines changed: 7 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -140,14 +140,11 @@ void GitBlocks::Clone(wxCommandEvent &event)
140140

141141
void GitBlocks::Destroy(wxCommandEvent &event)
142142
{
143-
if(wxMessageBox(_("Are you sure you want to destroy the repository?"), _("Destroy repository"), wxYES_NO) == wxYES)
143+
if(wxMessageBox(_("Are you sure you want to destroy the local repository?"), _("Destroy local repository"), wxYES_NO) == wxYES)
144144
{
145-
#ifdef __WXMSW__ // Fucking hipster Windows needs some extra code
146-
wxString command = _("RD /S .git");
147-
#else
148-
wxString command = _("rm -r .git");
149-
#endif
150-
Execute(command, _("Destroying the repository ..."));
145+
Manager::Get()->GetLogManager()->Log(_("Destroying the local repository ..."), logSlot);
146+
Manager::Get()->GetLogManager()->Log(_("<rmdir> .git"), logSlot);
147+
wxRmdir(wxGetCwd() + _("/.git"));
151148
}
152149
}
153150

@@ -189,7 +186,7 @@ void GitBlocks::CommitAll(wxCommandEvent &event)
189186

190187
void GitBlocks::Push(wxCommandEvent &event)
191188
{
192-
#ifdef __WXMSW__ // Fucking hipster Windows needs some extra code
189+
#ifdef __WXMSW__ // Windows needs some extra code
193190
wxString command = _("cmd.exe /C \"") + git + _(" push origin master\"");
194191
#else
195192
wxString command = _("xterm -e \"") + git + _(" push origin HEAD\"");
@@ -199,7 +196,7 @@ void GitBlocks::Push(wxCommandEvent &event)
199196

200197
void GitBlocks::Pull(wxCommandEvent &event)
201198
{
202-
#ifdef __WXMSW__ // Fucking hipster Windows needs some extra code
199+
#ifdef __WXMSW__ // Windows needs some extra code
203200
wxString command = _("cmd.exe /C \"") + git + _(" pull origin\"");
204201
#else
205202
wxString command = _("xterm -e \"") + git + _(" pull origin\"");
@@ -209,7 +206,7 @@ void GitBlocks::Pull(wxCommandEvent &event)
209206

210207
void GitBlocks::Fetch(wxCommandEvent &event)
211208
{
212-
#ifdef __WXMSW__ // Fucking hipster Windows needs some extra code
209+
#ifdef __WXMSW__ // Windows needs some extra code
213210
wxString command = _("cmd.exe /C \"") + git + _(" fetch origin\"");
214211
#else
215212
wxString command = _("xterm -e \"") + git + _(" fetch origin\"");

0 commit comments

Comments
 (0)