From f003f67129e0d0d2ca92caf6928088fb7e9e9e24 Mon Sep 17 00:00:00 2001 From: leo Date: Thu, 5 Jun 2025 21:54:09 +0800 Subject: [PATCH] fix: should use `file.SHA` instead of `_commit.SHA` to query submodule's commit Signed-off-by: leo --- src/ViewModels/CommitDetail.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/ViewModels/CommitDetail.cs b/src/ViewModels/CommitDetail.cs index 10ee336a..2fe85653 100644 --- a/src/ViewModels/CommitDetail.cs +++ b/src/ViewModels/CommitDetail.cs @@ -245,9 +245,9 @@ namespace SourceGit.ViewModels case Models.ObjectType.Commit: Task.Run(() => { - var submoduleRoot = Path.Combine(_repo.FullPath, file.Path); - var commit = new Commands.QuerySingleCommit(submoduleRoot, _commit.SHA).Result(); - var message = commit != null ? new Commands.QueryCommitFullMessage(submoduleRoot, _commit.SHA).Result() : null; + var submoduleRoot = Path.Combine(_repo.FullPath, file.Path).Replace('\\', '/').Trim('/'); + var commit = new Commands.QuerySingleCommit(submoduleRoot, file.SHA).Result(); + var message = commit != null ? new Commands.QueryCommitFullMessage(submoduleRoot, file.SHA).Result() : null; var module = new Models.RevisionSubmodule() { Commit = commit ?? new Models.Commit() { SHA = _commit.SHA },