Minor fixes.

This commit is contained in:
Martín Lucas Golini
2024-01-30 18:44:50 -03:00
parent f2324d8f40
commit 9a0368af1d
3 changed files with 20 additions and 3 deletions

View File

@@ -1338,11 +1338,11 @@ void GitPlugin::buildSidePanelTab() {
if ( id == "git-commit" ) {
commit( repoPath );
} else if ( id == "git-stage-all" ) {
stage( model->getFiles( repoName( repoPath ),
stage( model->getFiles( repoFullName( repoPath ),
(Uint32)Git::GitStatusType::Untracked |
(Uint32)Git::GitStatusType::Changed ) );
} else if ( id == "git-unstage-all" ) {
unstage( model->getFiles( repoName( repoPath ),
unstage( model->getFiles( repoFullName( repoPath ),
(Uint32)Git::GitStatusType::Staged ) );
}
} );
@@ -1585,6 +1585,21 @@ std::string GitPlugin::repoName( const std::string& repoPath ) {
return "";
}
std::string GitPlugin::repoFullName( const std::string& repoPath ) {
Lock l( mRepoMutex );
for ( const auto& repo : mRepos ) {
if ( repo.first == repoPath ) {
if ( repoPath != mProjectPath ) {
auto fullName( repo.first );
FileSystem::filePathRemoveBasePath( mProjectPath, fullName );
return fullName;
}
return repo.second;
}
}
return "";
}
std::string GitPlugin::repoPath( const std::string& repoName ) {
Lock l( mRepoMutex );
for ( const auto& repo : mRepos )

View File

@@ -215,6 +215,8 @@ class GitPlugin : public PluginBase {
std::string repoPath( const std::string& repoName );
std::string repoFullName( const std::string& repoPath );
std::string fixFilePath( const std::string& file );
std::vector<std::string> fixFilePaths( const std::vector<std::string>& files );