Allow to pass std::string and std::string_view as a %s parameter in String::format and Log::debug/info/etc.

This commit is contained in:
Martín Lucas Golini
2024-01-06 10:37:38 -03:00
parent 748ead4a97
commit eec3397592
6 changed files with 65 additions and 69 deletions

View File

@@ -45,7 +45,7 @@ void Git::git( const std::string& args, const std::string& projectDir, std::stri
void Git::gitSubmodules( const std::string& args, const std::string& projectDir,
std::string& buf ) {
git( String::format( "submodule foreach \"git %s\"", args.c_str() ), projectDir, buf );
git( String::format( "submodule foreach \"git %s\"", args ), projectDir, buf );
}
std::string Git::branch( const std::string& projectDir ) {
@@ -227,7 +227,7 @@ Git::Blame Git::blame( const std::string& filepath, std::size_t line ) const {
auto commitMessage = getText( "summary"sv );
git( String::format( "rev-parse --short %s", commitHash.c_str() ), workingDir, buf );
git( String::format( "rev-parse --short %s", commitHash ), workingDir, buf );
auto commitShortHash = String::rTrim( buf, '\n' );