From 0e967ffc8e28a361d3bc4a48a1f72e38a58897c7 Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 17 Apr 2025 13:30:25 +0800 Subject: [PATCH] fix: pressing `Alt+Enter` to commit and push in a repository that has no remotes will crash (#1205) Signed-off-by: leo --- src/ViewModels/WorkingCopy.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/ViewModels/WorkingCopy.cs b/src/ViewModels/WorkingCopy.cs index 60b8fd11..10544970 100644 --- a/src/ViewModels/WorkingCopy.cs +++ b/src/ViewModels/WorkingCopy.cs @@ -1735,7 +1735,7 @@ namespace SourceGit.ViewModels CommitMessage = string.Empty; UseAmend = false; - if (autoPush) + if (autoPush && _repo.Remotes.Count > 0) _repo.ShowAndStartPopup(new Push(_repo, null)); }