在提交中对新添加的文件使用 TortoiseGit diff 命令时出错

Error when using TortoiseGit diff command with new added file in commit

我尝试让我的自定义程序与 git 一起工作。有些任务比如比较两个文件之间的差异我只是创建新进程和 运行 TortoiseGit 命令像这样

/command:diff /startrev:20404fc1039ce9ee73f0d16213319afe480b0a05 /endrev:294e111888ed87a8c93a898f6e6f061b15250e0d /path:D:/Project/ReportingTool/Src/Reports.Types/Report.cs

在修改后的提交文件上,我得到了与 TortoiseGit UI 相同的结果。 picture here

问题是,在新添加的提交文件上,之前修订版中没有文件要签出以进行比较。一个错误说

failed to checkout file "files/powershell/App_BuildAndDeploy.ps1" of 
revision 62f7869c1780e6501ec1c4dc0387f03efbde10da to 
"C:\Users\ME\AppData\Local\Temp\TortoiseGit\AppAAD3.tmp\App_BuildAndDeploy-
62f7869-left.ps1" libgit2 returned:the path 'App_BuildAndDeploy.ps1' does 
not exist in the given tree

如何得到像这张图这样的 TortoiseGit 结果,desired result。

我知道我可以在某处创建新的空文件并用它来比较,但我不确定这是 best/correct 的方法

这是旧版本 TortoiseGit 和 is fixed TortoiseGit 2.5.0 中的问题。

请注意:/startrev:/endrev: 参数在旧版本中混淆了,您可能需要调整这些值。