diff --git a/src/ViewModels/Histories.cs b/src/ViewModels/Histories.cs
index 9f5107b0..af4f555e 100644
--- a/src/ViewModels/Histories.cs
+++ b/src/ViewModels/Histories.cs
@@ -217,6 +217,12 @@ namespace SourceGit.ViewModels
reword.Icon = App.CreateMenuIcon("Icons.Edit");
reword.Click += (o, e) =>
{
+ if (_repo.WorkingCopyChangesCount > 0)
+ {
+ App.RaiseException(_repo.FullPath, "You have local changes. Please run stash or discard first.");
+ return;
+ }
+
if (PopupHost.CanCreatePopup())
PopupHost.ShowPopup(new Reword(_repo, commit));
e.Handled = true;
@@ -229,6 +235,12 @@ namespace SourceGit.ViewModels
squash.IsEnabled = commit.Parents.Count == 1;
squash.Click += (o, e) =>
{
+ if (_repo.WorkingCopyChangesCount > 0)
+ {
+ App.RaiseException(_repo.FullPath, "You have local changes. Please run stash or discard first.");
+ return;
+ }
+
if (commit.Parents.Count == 1)
{
var parent = _commits.Find(x => x.SHA == commit.Parents[0]);
diff --git a/src/ViewModels/Squash.cs b/src/ViewModels/Squash.cs
index c001dfab..4b35266b 100644
--- a/src/ViewModels/Squash.cs
+++ b/src/ViewModels/Squash.cs
@@ -27,7 +27,7 @@ namespace SourceGit.ViewModels
public Squash(Repository repo, Models.Commit head, Models.Commit parent)
{
_repo = repo;
- _message = new Commands.QueryCommitFullMessage(_repo.FullPath, parent.SHA).Result();
+ _message = new Commands.QueryCommitFullMessage(_repo.FullPath, head.SHA).Result();
Head = head;
Parent = parent;
diff --git a/src/Views/Squash.axaml b/src/Views/Squash.axaml
index cdfcac94..38794ce7 100644
--- a/src/Views/Squash.axaml
+++ b/src/Views/Squash.axaml
@@ -12,40 +12,38 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
-
-
-
-
+
+
+
+
+
+
+