| 1081 | } |
| 1082 | |
| 1083 | void GitPlugin::diff( const Git::DiffMode mode, const std::string& repoPath ) { |
| 1084 | mThreadPool->run( [this, mode, repoPath] { |
| 1085 | auto res = mGit->diff( mode, repoPath ); |
| 1086 | if ( res.fail() ) |
| 1087 | return; |
| 1088 | |
| 1089 | std::string repoName = this->repoName( repoPath ); |
| 1090 | getUISceneNode()->runOnMainThread( [this, mode, res, repoName] { |
| 1091 | std::string modeName; |
| 1092 | switch ( mode ) { |
| 1093 | case Git::DiffHead: { |
| 1094 | modeName = "HEAD"; |
| 1095 | break; |
| 1096 | } |
| 1097 | case Git::DiffStaged: |
| 1098 | modeName = "staged"; |
| 1099 | break; |
| 1100 | } |
| 1101 | getPluginContext()->loadDiffFromMemory( |
| 1102 | res.result, UIDiffView::isMultiFileDiff( res.result ) ? modeName : "" ); |
| 1103 | } ); |
| 1104 | } ); |
| 1105 | } |
| 1106 | |
| 1107 | void GitPlugin::diff( const std::string& file, Git::GitStatusType status ) { |
| 1108 | mThreadPool->run( [this, file, status] { |
nothing calls this directly
no test coverage detected