Minor fix in C++ syntax highlight.
Improved TextDocument indentation guessing.
UIMessageBox with type TEXT_EDIT now focuses the text edit by default.
ecode:
Allow to merge branches.
If HEAD branch doesn't have origin, on commit + push it will push the new branch into origin.
This commit is contained in:
Martín Lucas Golini
2024-01-31 20:49:45 -03:00
parent ea0f34de7e
commit f454695ae9
10 changed files with 166 additions and 61 deletions

View File

@@ -163,6 +163,14 @@ Git::Result Git::push( const std::string& projectDir ) {
return gitSimple( "push", projectDir );
}
Git::Result Git::pushNewBranch( const std::string& branch, const std::string& projectDir ) {
return gitSimple(
String::format(
"push --porcelain --recurse-submodules=check origin refs/heads/%s:refs/heads/%s",
branch, branch ),
projectDir );
}
Git::CheckoutResult Git::checkout( const std::string& branch,
const std::string& projectDir ) const {
std::string buf;
@@ -250,6 +258,10 @@ Git::Result Git::deleteBranch( const std::string& branch, const std::string& pro
return gitSimple( String::format( "branch -D %s", branch ), projectDir );
}
Git::Result Git::mergeBranch( const std::string& branch, const std::string& projectDir ) {
return gitSimple( String::format( "merge --no-ff %s", branch ), projectDir );
}
Git::Result Git::commit( const std::string& commitMsg, bool ammend, bool byPassCommitHook,
const std::string& projectDir ) {
auto tmpPath = Sys::getTempPath() + ".ecode-git-commit-" + String::randString( 16 );