diff --git a/src/Joba.IBM.RPA.Cli/SourceControl/GitCommand.Config.cs b/src/Joba.IBM.RPA.Cli/SourceControl/GitCommand.Config.cs index 748c9c6..089da45 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"; + internal static readonly string GitMergeCommandLine = $"{RpaCommand.CommandName} {GitCommand.CommandName} {GitCommand.MergeCommand.CommandName} %O %A %B -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 cb5d1c3..278ba92 100644 --- a/src/Joba.IBM.RPA.Cli/SourceControl/GitCommand.Merge.cs +++ b/src/Joba.IBM.RPA.Cli/SourceControl/GitCommand.Merge.cs @@ -41,7 +41,7 @@ private async Task HandleAsync(FileInfo baseFile, FileInfo localFile, FileInfo r //TODO: not working... the 'base' file is corrupted by git :( logger.LogDebug("Reading base {File} (exists={Exists})", baseFile, baseFile.Exists); - File.Copy(baseFile.FullName, @"C:\Users\002742631\Desktop\base.wal", true); + //Console.ReadLine(); var baseWal = WalFile.Read(baseFile); logger.LogDebug("Reading local {File}", localFile); var localWal = WalFile.Read(localFile); diff --git a/src/Joba.IBM.RPA/Git/GitConfigurator.cs b/src/Joba.IBM.RPA/Git/GitConfigurator.cs index 60b737e..20eeec3 100644 --- a/src/Joba.IBM.RPA/Git/GitConfigurator.cs +++ b/src/Joba.IBM.RPA/Git/GitConfigurator.cs @@ -66,7 +66,7 @@ internal GitAttributes(DirectoryInfo workingDir, string cliName) internal GitAttributes(FileInfo file, string cliName) { this.file = file; - pattern = $"*{WalFile.Extension} diff={cliName} merge={cliName}"; + pattern = $"*{WalFile.Extension} diff={cliName} merge={cliName} -text"; comment = $"# DO NOT EDIT next line - auto-generated by '{cliName}'"; } @@ -350,7 +350,6 @@ private async Task ConfigureMergeDriverAsync(CancellationToken cancellation) await ConfigureNameAsync(cancellation); await ConfigureDriverAsync(cancellation); - await ConfigureRecursiveAsync(cancellation); async Task ConfigureNameAsync(CancellationToken cancellation) { @@ -387,24 +386,6 @@ async Task ConfigureDriverAsync(CancellationToken cancellation) logger.LogInformation("Git output: {Output}", output); await process.WaitForExitAsync(cancellation); } - - async Task ConfigureRecursiveAsync(CancellationToken cancellation) - { - var fileName = "git"; - var arguments = $"config --global merge.{cliName}.recursive text"; - logger.LogDebug("Executing {FileName} {Arguments}", fileName, arguments); - - var info = new ProcessStartInfo(fileName, arguments) { UseShellExecute = false, RedirectStandardError = true, RedirectStandardOutput = true }; - var process = Process.Start(info); - if (process == null) - throw new Exception($"Could not start '{info.FileName} {info.Arguments}'"); - process.ErrorDataReceived += OnGitError; - process.BeginErrorReadLine(); - var output = await process.StandardOutput.ReadToEndAsync(cancellation); - if (!string.IsNullOrEmpty(output)) - logger.LogInformation("Git output: {Output}", output); - await process.WaitForExitAsync(cancellation); - } } private void OnGitError(object sender, DataReceivedEventArgs e) diff --git a/src/Tests/Joba.IBM.RPA.Tests/assets/gitattributes/AddPattern.verified.txt b/src/Tests/Joba.IBM.RPA.Tests/assets/gitattributes/AddPattern.verified.txt index b995796..2a9ea7a 100644 --- a/src/Tests/Joba.IBM.RPA.Tests/assets/gitattributes/AddPattern.verified.txt +++ b/src/Tests/Joba.IBM.RPA.Tests/assets/gitattributes/AddPattern.verified.txt @@ -14,4 +14,4 @@ *.sh text eol=lf # DO NOT EDIT next line - auto-generated by 'rpa' -*.wal diff=rpa merge=rpa +*.wal diff=rpa merge=rpa -text diff --git a/src/Tests/Joba.IBM.RPA.Tests/assets/gitattributes/UpdatePattern.verified.txt b/src/Tests/Joba.IBM.RPA.Tests/assets/gitattributes/UpdatePattern.verified.txt index c91b298..9642198 100644 --- a/src/Tests/Joba.IBM.RPA.Tests/assets/gitattributes/UpdatePattern.verified.txt +++ b/src/Tests/Joba.IBM.RPA.Tests/assets/gitattributes/UpdatePattern.verified.txt @@ -8,7 +8,7 @@ *.ps1 text working-tree-encoding=UTF-16 # DO NOT EDIT next line - auto-generated by 'rpa' -*.wal diff=rpa merge=rpa +*.wal diff=rpa merge=rpa -text # DO NOT EDIT: File is auto-generated *.cmd text eol=crlf