Skip to content

Commit

Permalink
fix(git): vscode now shows correct file name
Browse files Browse the repository at this point in the history
Signed-off-by: JobaDiniz <[email protected]>
  • Loading branch information
JobaDiniz committed Oct 28, 2023
1 parent 4d20a30 commit dcc468a
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion src/Joba.IBM.RPA.Cli/SourceControl/GitCommand.Config.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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
{
Expand Down
12 changes: 6 additions & 6 deletions src/Joba.IBM.RPA.Cli/SourceControl/GitCommand.Merge.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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<GitCommand> logger, InvocationContext context)
{
logger.LogDebug("Files: base={base} | local={local} | remote={remote} | merged={merged}", baseFile, localFile, remoteFile, mergedFile?.FullName ?? "<null>");
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'
Expand All @@ -39,21 +39,21 @@ 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);
logger.LogDebug("Reading remote {File}", remoteFile);
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);
Expand Down

0 comments on commit dcc468a

Please sign in to comment.