Skip to content

Commit

Permalink
Fixed: Currently the git plugin has a problem to do "git pull --rebas…
Browse files Browse the repository at this point in the history
…e" if there are

changes that need to be stashed first (René Kraus)
  • Loading branch information
eranif committed Apr 15, 2014
1 parent e2238d9 commit f0a9e1b
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 15 deletions.
4 changes: 2 additions & 2 deletions LiteEditor.workspace
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@
<Project Name="wxsqlite3" ConfigName="WinDebugUnicode"/>
<Project Name="ZoomNavigator" ConfigName="WinDebugUnicode"/>
</WorkspaceConfiguration>
<WorkspaceConfiguration Name="CMake_Release" Selected="no">
<WorkspaceConfiguration Name="CMake_Release" Selected="yes">
<Project Name="ZoomNavigator" ConfigName="DebugUnicode"/>
<Project Name="wxsqlite3" ConfigName="WinReleaseUnicode"/>
<Project Name="wxshapeframework" ConfigName="WinReleaseUnicode"/>
Expand Down Expand Up @@ -157,7 +157,7 @@
<Project Name="CodeLiteDiff" ConfigName="DebugUnicode"/>
<Project Name="LLDBDebugger" ConfigName="DebugUnicode"/>
</WorkspaceConfiguration>
<WorkspaceConfiguration Name="CMake_Debug" Selected="yes">
<WorkspaceConfiguration Name="CMake_Debug" Selected="no">
<Project Name="ZoomNavigator" ConfigName="WinReleaseUnicode"/>
<Project Name="wxsqlite3" ConfigName="WinReleaseUnicode"/>
<Project Name="wxshapeframework" ConfigName="WinReleaseUnicode"/>
Expand Down
21 changes: 9 additions & 12 deletions git/git.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -613,10 +613,12 @@ void GitPlugin::OnPush(wxCommandEvent &e)
/*******************************************************************************/
void GitPlugin::OnPull(wxCommandEvent &e)
{
wxString commandString = e.GetString(); // This might be user-specified e.g. pull --rebase
if (commandString.empty()) {
commandString = GetAnyDefaultCommand("git_pull");
wxString argumentString = e.GetString(); // This might be user-specified e.g. pull --rebase
if (argumentString.empty()) {
argumentString = GetAnyDefaultCommand("git_pull");
}
argumentString.Replace("pull", "");
argumentString.Trim(false);

wxStandardID res = ::PromptForYesNoDialogWithCheckbox(_("Save all changes and pull remote changes?"), "GitPullRemoteChanges");
if( res == wxID_YES ) {
Expand All @@ -626,15 +628,15 @@ void GitPlugin::OnPull(wxCommandEvent &e)
m_gitActionQueue.push(ga);
}
{
gitAction ga(gitPull, wxT(""));
gitAction ga(gitPull, argumentString);
m_gitActionQueue.push(ga);
}
if ( m_console->IsDirty() ) {
gitAction ga(gitStashPop, wxT(""));
m_gitActionQueue.push(ga);
}
AddDefaultActions();
ProcessGitActionQueue(commandString);
ProcessGitActionQueue();
}
}

Expand Down Expand Up @@ -805,7 +807,7 @@ void GitPlugin::OnInitDone(wxCommandEvent& e)
m_topWindow = m_mgr->GetTheApp()->GetTopWindow();
}
/*******************************************************************************/
void GitPlugin::ProcessGitActionQueue(const wxString& commandString /*= ""*/)
void GitPlugin::ProcessGitActionQueue()
{
if(m_gitActionQueue.size() == 0)
return;
Expand Down Expand Up @@ -934,12 +936,7 @@ void GitPlugin::ProcessGitActionQueue(const wxString& commandString /*= ""*/)
case gitPull:
GIT_MESSAGE(wxT("Pull remote changes"));
ShowProgress(wxT("Obtaining remote changes"), false);
command << " --no-pager ";
if (commandString.empty()) {
command << " pull ";
} else {
command << commandString;
}
command << " --no-pager pull " << ga.arguments;
command << " --log";
GIT_MESSAGE(wxT("%s. Repo path: %s"), command.c_str(), m_repositoryDirectory.c_str());
break;
Expand Down
2 changes: 1 addition & 1 deletion git/git.h
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ class GitPlugin : public IPlugin
void InitDefaults();
void AddDefaultActions();
void LoadDefaultGitCommands(GitEntry& data, bool overwrite = false);
void ProcessGitActionQueue(const wxString& commandString = "");
void ProcessGitActionQueue();
void ColourFileTree(wxTreeCtrl *tree, const wxStringSet_t& files, OverlayTool::BmpType bmpType) const;
void CreateFilesTreeIDsMap(std::map<wxString, wxTreeItemId>& IDs, bool ifmodified = false) const;

Expand Down

0 comments on commit f0a9e1b

Please sign in to comment.