From 8b469e77782560e6ac2a59a11471cb62cbb4a8f7 Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 22 Aug 2024 14:10:32 +0800 Subject: [PATCH] enhance: show untracked submodules in unstaged (#393) --- src/Commands/QueryLocalChanges.cs | 2 -- src/ViewModels/DiffContext.cs | 8 ++++++++ 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/Commands/QueryLocalChanges.cs b/src/Commands/QueryLocalChanges.cs index d58f42f4..bdef9bf8 100644 --- a/src/Commands/QueryLocalChanges.cs +++ b/src/Commands/QueryLocalChanges.cs @@ -28,8 +28,6 @@ namespace SourceGit.Commands var match = REG_FORMAT().Match(line); if (!match.Success) return; - if (line.EndsWith("/", StringComparison.Ordinal)) - return; // Ignore changes with git-worktree var change = new Models.Change() { Path = match.Groups[2].Value }; var status = match.Groups[1].Value; diff --git a/src/ViewModels/DiffContext.cs b/src/ViewModels/DiffContext.cs index db5382d4..d15b21a8 100644 --- a/src/ViewModels/DiffContext.cs +++ b/src/ViewModels/DiffContext.cs @@ -87,6 +87,14 @@ namespace SourceGit.ViewModels private void LoadDiffContent() { + if (_option.Path.EndsWith('/')) + { + Content = null; + IsTextDiff = false; + IsLoading = false; + return; + } + var unified = Preference.Instance.DiffViewVisualLineNumbers; Task.Run(() => {