diff --git a/src/Models/DiffOption.cs b/src/Models/DiffOption.cs
index f5bec602..e122ad67 100644
--- a/src/Models/DiffOption.cs
+++ b/src/Models/DiffOption.cs
@@ -80,7 +80,7 @@ namespace SourceGit.Models
///
public DiffOption(string baseRevision, string targetRevision, Change change)
{
- _revisions.Add(baseRevision);
+ _revisions.Add(string.IsNullOrEmpty(baseRevision) ? "-R" : baseRevision);
_revisions.Add(targetRevision);
_path = change.Path;
_orgPath = change.OriginalPath;
diff --git a/src/Models/Null.cs b/src/Models/Null.cs
new file mode 100644
index 00000000..e22ef8b3
--- /dev/null
+++ b/src/Models/Null.cs
@@ -0,0 +1,6 @@
+namespace SourceGit.Models
+{
+ public class Null
+ {
+ }
+}
diff --git a/src/SourceGit.csproj b/src/SourceGit.csproj
index 3f6aabc9..ecb55bd2 100644
--- a/src/SourceGit.csproj
+++ b/src/SourceGit.csproj
@@ -52,7 +52,7 @@
-
+
-
\ No newline at end of file
+
diff --git a/src/ViewModels/Discard.cs b/src/ViewModels/Discard.cs
index 641c5232..f37d5f0c 100644
--- a/src/ViewModels/Discard.cs
+++ b/src/ViewModels/Discard.cs
@@ -15,7 +15,7 @@ namespace SourceGit.ViewModels
{
_repo = repo;
- Mode = null;
+ Mode = new Models.Null();
View = new Views.Discard { DataContext = this };
}
@@ -26,7 +26,7 @@ namespace SourceGit.ViewModels
_isUnstaged = isUnstaged;
if (_changes == null)
- Mode = null;
+ Mode = new Models.Null();
else if (_changes.Count == 1)
Mode = _changes[0].Path;
else
diff --git a/src/ViewModels/RevisionCompare.cs b/src/ViewModels/RevisionCompare.cs
index 8ac6f823..55c85129 100644
--- a/src/ViewModels/RevisionCompare.cs
+++ b/src/ViewModels/RevisionCompare.cs
@@ -71,8 +71,8 @@ namespace SourceGit.ViewModels
public RevisionCompare(string repo, Models.Commit startPoint, Models.Commit endPoint)
{
_repo = repo;
- _startPoint = startPoint;
- _endPoint = endPoint;
+ _startPoint = (object)startPoint ?? new Models.Null();
+ _endPoint = (object)endPoint ?? new Models.Null();
Task.Run(Refresh);
}
diff --git a/src/Views/Discard.axaml b/src/Views/Discard.axaml
index 73532887..e67600d7 100644
--- a/src/Views/Discard.axaml
+++ b/src/Views/Discard.axaml
@@ -2,6 +2,7 @@
xmlns:x="http://schemas.microsoft.com/winfx/2006/xaml"
xmlns:d="http://schemas.microsoft.com/expression/blend/2008"
xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006"
+ xmlns:m="using:SourceGit.Models"
xmlns:vm="using:SourceGit.ViewModels"
xmlns:c="using:SourceGit.Converters"
mc:Ignorable="d" d:DesignWidth="500" d:DesignHeight="450"
@@ -14,19 +15,15 @@
-
-
-
-
-
-
-
-
-
-
-
-
+
+
+
+
+
+
+
+
@@ -37,7 +34,7 @@
-
+
diff --git a/src/Views/RevisionCompare.axaml b/src/Views/RevisionCompare.axaml
index 52bd8d9e..14ac66a7 100644
--- a/src/Views/RevisionCompare.axaml
+++ b/src/Views/RevisionCompare.axaml
@@ -11,6 +11,12 @@
x:DataType="vm:RevisionCompare"
Background="{DynamicResource Brush.Window}">
+
+
+
+
+
+
@@ -33,17 +39,7 @@
-
-
-
-
-
-
-
-
-
-
-
+
@@ -53,17 +49,7 @@
-
-
-
-
-
-
-
-
-
-
-
+