ecode: Visual improvements.

This commit is contained in:
Martín Lucas Golini
2023-12-17 19:11:41 -03:00
parent ac35e9ca0e
commit 05684dffc9
12 changed files with 163 additions and 45 deletions

View File

@@ -49,6 +49,7 @@ std::string Git::branch( std::string projectDir ) {
bool Git::setProjectPath( std::string projectPath ) {
mProjectPath = "";
mGitFolder = "";
FileInfo f( projectPath );
if ( !f.isDirectory() )
return false;
@@ -57,8 +58,10 @@ bool Git::setProjectPath( std::string projectPath ) {
std::string lPath;
FileSystem::dirAddSlashAtEnd( path );
while ( path != lPath ) {
if ( FileSystem::fileExists( path + ".git" ) ) {
std::string gitFolder( path + ".git" );
if ( FileSystem::fileExists( gitFolder ) ) {
mProjectPath = path;
mGitFolder = std::move( gitFolder );
return true;
}
lPath = path;
@@ -67,6 +70,10 @@ bool Git::setProjectPath( std::string projectPath ) {
return false;
}
const std::string& Git::getGitFolder() const {
return mGitFolder;
}
Git::Status Git::status( std::string projectDir ) {
Status s;
std::string buf;