mirror of
https://github.com/sourcegit-scm/sourcegit
synced 2025-05-23 13:14:59 +00:00
enhance: manually stage all changes instead of using --all
parameter in git commit
This commit is contained in:
parent
3bcea2a4f0
commit
2ffc1b7178
10 changed files with 16 additions and 21 deletions
|
@ -39,7 +39,7 @@ namespace SourceGit.ViewModels
|
|||
|
||||
return Task.Run(() =>
|
||||
{
|
||||
var succ = new Commands.Commit(_repo.FullPath, _message, false, true, true).Exec();
|
||||
var succ = new Commands.Commit(_repo.FullPath, _message, true, true).Exec();
|
||||
CallUIThread(() => _repo.SetWatcherEnabled(true));
|
||||
return succ;
|
||||
});
|
||||
|
|
|
@ -43,7 +43,7 @@ namespace SourceGit.ViewModels
|
|||
{
|
||||
var succ = new Commands.Reset(_repo.FullPath, Parent.SHA, "--soft").Exec();
|
||||
if (succ)
|
||||
succ = new Commands.Commit(_repo.FullPath, _message, false, true).Exec();
|
||||
succ = new Commands.Commit(_repo.FullPath, _message, true).Exec();
|
||||
CallUIThread(() => _repo.SetWatcherEnabled(true));
|
||||
return succ;
|
||||
});
|
||||
|
|
|
@ -1282,9 +1282,10 @@ namespace SourceGit.ViewModels
|
|||
return;
|
||||
}
|
||||
|
||||
var autoStage = AutoStageBeforeCommit;
|
||||
if (!_useAmend)
|
||||
{
|
||||
if (AutoStageBeforeCommit)
|
||||
if (autoStage)
|
||||
{
|
||||
if (_count == 0)
|
||||
{
|
||||
|
@ -1306,26 +1307,28 @@ namespace SourceGit.ViewModels
|
|||
_repo.Settings.PushCommitMessage(_commitMessage);
|
||||
_repo.SetWatcherEnabled(false);
|
||||
|
||||
var autoStage = AutoStageBeforeCommit;
|
||||
Task.Run(() =>
|
||||
{
|
||||
var succ = new Commands.Commit(_repo.FullPath, _commitMessage, autoStage, _useAmend).Exec();
|
||||
var succ = true;
|
||||
if (autoStage && _unstaged.Count > 0)
|
||||
succ = new Commands.Add(_repo.FullPath).Exec();
|
||||
|
||||
if (succ)
|
||||
succ = new Commands.Commit(_repo.FullPath, _commitMessage, _useAmend).Exec();
|
||||
|
||||
Dispatcher.UIThread.Post(() =>
|
||||
{
|
||||
if (succ)
|
||||
{
|
||||
SelectedStaged = [];
|
||||
CommitMessage = string.Empty;
|
||||
UseAmend = false;
|
||||
|
||||
if (autoPush)
|
||||
{
|
||||
PopupHost.ShowAndStartPopup(new Push(_repo, null));
|
||||
}
|
||||
}
|
||||
|
||||
_repo.MarkWorkingCopyDirtyManually();
|
||||
_repo.SetWatcherEnabled(true);
|
||||
|
||||
IsCommitting = false;
|
||||
});
|
||||
});
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue