diff --git a/src/Commands/Commit.cs b/src/Commands/Commit.cs
index 6232fc17..b629f82d 100644
--- a/src/Commands/Commit.cs
+++ b/src/Commands/Commit.cs
@@ -4,7 +4,7 @@ namespace SourceGit.Commands
{
public class Commit : Command
{
- public Commit(string repo, string message, bool autoStage, bool amend, bool allowEmpty = false)
+ public Commit(string repo, string message, bool amend, bool allowEmpty = false)
{
var file = Path.GetTempFileName();
File.WriteAllText(file, message);
@@ -13,8 +13,6 @@ namespace SourceGit.Commands
Context = repo;
TraitErrorAsOutput = true;
Args = $"commit --file=\"{file}\"";
- if (autoStage)
- Args += " --all";
if (amend)
Args += " --amend --no-edit";
if (allowEmpty)
diff --git a/src/Resources/Locales/de_DE.axaml b/src/Resources/Locales/de_DE.axaml
index c656a869..cd162f52 100644
--- a/src/Resources/Locales/de_DE.axaml
+++ b/src/Resources/Locales/de_DE.axaml
@@ -588,7 +588,6 @@
Ignoriere nur diese Datei
Amend
Auto-Stage
- Weise den Befehl an automatisch Dateien zu stagen die verändert und modifiziert wurden, aber für Git unbekannte Dateien sind davon unberührt.
Du kannst diese Datei jetzt stagen.
COMMIT
COMMIT & PUSH
diff --git a/src/Resources/Locales/en_US.axaml b/src/Resources/Locales/en_US.axaml
index d8a6b4e9..6f03ef06 100644
--- a/src/Resources/Locales/en_US.axaml
+++ b/src/Resources/Locales/en_US.axaml
@@ -588,7 +588,6 @@
Ignore this file only
Amend
Auto-Stage
- Tell the command to automatically stage files that have been modified and deleted, but new files you have not told Git about are not affected.
You can stage this file now.
COMMIT
COMMIT & PUSH
diff --git a/src/Resources/Locales/pt_BR.axaml b/src/Resources/Locales/pt_BR.axaml
index 71c42efd..4c471a0e 100644
--- a/src/Resources/Locales/pt_BR.axaml
+++ b/src/Resources/Locales/pt_BR.axaml
@@ -574,7 +574,6 @@
Ignorar apenas este arquivo
Corrigir
Auto-Stage
- Informe ao comando para automaticamente stagear arquivos que foram modificados e excluídos, mas novos arquivos que você não informou ao Git não serão afetados.
Você pode stagear este arquivo agora.
COMMIT
COMMIT & PUSH
diff --git a/src/Resources/Locales/zh_CN.axaml b/src/Resources/Locales/zh_CN.axaml
index 742fcb80..96b85d7b 100644
--- a/src/Resources/Locales/zh_CN.axaml
+++ b/src/Resources/Locales/zh_CN.axaml
@@ -589,8 +589,7 @@
忽略同目录下所有文件
忽略本文件
修补(--amend)
- 自动暂存(--all)
- 提交前自动将修改过和删除的文件加入暂存区,但新增文件需要手动添加。
+ 自动暂存
现在您已可将其加入暂存区中
提交
提交并推送
diff --git a/src/Resources/Locales/zh_TW.axaml b/src/Resources/Locales/zh_TW.axaml
index 5ff3ff58..1f49fe1b 100644
--- a/src/Resources/Locales/zh_TW.axaml
+++ b/src/Resources/Locales/zh_TW.axaml
@@ -589,8 +589,7 @@
忽略同路徑下所有檔案
忽略本檔案
修補(--amend)
- 自動暫存(--all)
- 提交前自動將修改過和刪除的檔案加入暫存區,但新增檔案需要手動添加。
+ 自動暫存
現在您已可將其加入暫存區中
提交
提交併推送
diff --git a/src/ViewModels/Reword.cs b/src/ViewModels/Reword.cs
index ce2f4d6c..7ec873c8 100644
--- a/src/ViewModels/Reword.cs
+++ b/src/ViewModels/Reword.cs
@@ -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;
});
diff --git a/src/ViewModels/Squash.cs b/src/ViewModels/Squash.cs
index a24f5152..f0f4b8bb 100644
--- a/src/ViewModels/Squash.cs
+++ b/src/ViewModels/Squash.cs
@@ -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;
});
diff --git a/src/ViewModels/WorkingCopy.cs b/src/ViewModels/WorkingCopy.cs
index 9f795921..e22d015c 100644
--- a/src/ViewModels/WorkingCopy.cs
+++ b/src/ViewModels/WorkingCopy.cs
@@ -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;
});
});
diff --git a/src/Views/WorkingCopy.axaml b/src/Views/WorkingCopy.axaml
index f9d85d19..b8cab0e8 100644
--- a/src/Views/WorkingCopy.axaml
+++ b/src/Views/WorkingCopy.axaml
@@ -189,8 +189,7 @@
Margin="12,0,0,0"
HorizontalAlignment="Left"
IsChecked="{Binding AutoStageBeforeCommit, Mode=TwoWay}"
- Content="{DynamicResource Text.WorkingCopy.AutoStage}"
- ToolTip.Tip="{DynamicResource Text.WorkingCopy.AutoStage.Tip}"/>
+ Content="{DynamicResource Text.WorkingCopy.AutoStage}"/>