From dcc468a92c30d440ae9587e20a4622bf04a060d1 Mon Sep 17 00:00:00 2001 From: JobaDiniz Date: Sat, 28 Oct 2023 15:16:57 -0300 Subject: [PATCH] fix(git): vscode now shows correct file name Signed-off-by: JobaDiniz --- .../SourceControl/GitCommand.Config.cs | 2 +- .../SourceControl/GitCommand.Merge.cs | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/Joba.IBM.RPA.Cli/SourceControl/GitCommand.Config.cs b/src/Joba.IBM.RPA.Cli/SourceControl/GitCommand.Config.cs index 089da45..b3eb6bc 100644 --- a/src/Joba.IBM.RPA.Cli/SourceControl/GitCommand.Config.cs +++ b/src/Joba.IBM.RPA.Cli/SourceControl/GitCommand.Config.cs @@ -5,7 +5,7 @@ namespace Joba.IBM.RPA.Cli internal partial class GitCommand { internal static readonly string GitDiffCommandLine = $"{RpaCommand.CommandName} {GitCommand.CommandName} {GitCommand.DiffCommand.CommandName} \"$1\""; - internal static readonly string GitMergeCommandLine = $"{RpaCommand.CommandName} {GitCommand.CommandName} {GitCommand.MergeCommand.CommandName} %O %A %B -v"; + internal static readonly string GitMergeCommandLine = $"{RpaCommand.CommandName} {GitCommand.CommandName} {GitCommand.MergeCommand.CommandName} %O %A %B %P -v"; internal class ConfigureCommand : Command { diff --git a/src/Joba.IBM.RPA.Cli/SourceControl/GitCommand.Merge.cs b/src/Joba.IBM.RPA.Cli/SourceControl/GitCommand.Merge.cs index 278ba92..4000e16 100644 --- a/src/Joba.IBM.RPA.Cli/SourceControl/GitCommand.Merge.cs +++ b/src/Joba.IBM.RPA.Cli/SourceControl/GitCommand.Merge.cs @@ -30,7 +30,7 @@ public MergeCommand() : base(CommandName, "Help git merging wal files. If confli private async Task HandleAsync(FileInfo baseFile, FileInfo localFile, FileInfo remoteFile, FileInfo? mergedFile, ILogger logger, InvocationContext context) { - logger.LogDebug("Files: base={base} | local={local} | remote={remote} | merged={merged}", baseFile, localFile, remoteFile, mergedFile?.FullName ?? ""); + logger.LogDebug("Files: base={base} | local={local} | remote={remote} | merged={merged}", baseFile, localFile, remoteFile, mergedFile?.FullName); var cancellation = context.GetCancellationToken(); mergedFile ??= localFile; //if 'merged' was not provided, then save the merge result back to 'local' @@ -39,9 +39,9 @@ private async Task HandleAsync(FileInfo baseFile, FileInfo localFile, FileInfo r remoteFile = new FileInfo(Path.GetFullPath(remoteFile.FullName)); mergedFile = new FileInfo(Path.GetFullPath(mergedFile.FullName)); - //TODO: not working... the 'base' file is corrupted by git :( + var fileName = mergedFile.Name; + logger.LogDebug("Reading base {File} (exists={Exists})", baseFile, baseFile.Exists); - //Console.ReadLine(); var baseWal = WalFile.Read(baseFile); logger.LogDebug("Reading local {File}", localFile); var localWal = WalFile.Read(localFile); @@ -49,11 +49,11 @@ private async Task HandleAsync(FileInfo baseFile, FileInfo localFile, FileInfo r var remoteWal = WalFile.Read(remoteFile); var mergedWal = mergedFile.Exists ? WalFile.Read(mergedFile) : remoteWal.CloneTo(mergedFile); - using var baseTxt = await TempFile.CreateAsync(baseWal, "base", cancellation); + using var baseTxt = await TempFile.CreateAsync(baseWal, $"base {fileName}", cancellation); logger.LogDebug("Temp created for base {File}", baseTxt.Info); - using var localTxt = await TempFile.CreateAsync(localWal, "local", cancellation); + using var localTxt = await TempFile.CreateAsync(localWal, $"local {fileName}", cancellation); logger.LogDebug("Temp created for local {File}", localTxt.Info); - using var remoteTxt = await TempFile.CreateAsync(remoteWal, "remote", cancellation); + using var remoteTxt = await TempFile.CreateAsync(remoteWal, $"remote {fileName}", cancellation); logger.LogDebug("Temp created for remote {File}", remoteTxt.Info); using var mergedTxt = await TempFile.CreateAsync(mergedWal, "merged", cancellation); logger.LogDebug("Temp created for merged {File}", mergedTxt.Info);