Andrew Cuthbert在2016年指出,git diff也会锁定文件,直到你退出它。
git diff仍然如此,但对于git 2.23(2019年第三季度),对于外部diff工具(正如Burkart在评论中报道的那样),情况将不再如此。
参见Johannes Schindelin (dscho)的commit 3aef54e(2019年7月11日)。
(由Junio C Hamano - gitster -在commit d9beb46中合并,2019年7月25日)
Diff:运行外部Diff前的munmap()文件内容
When running an external diff from, say, a diff tool, it is safe to
assume that we want to write the files in question.
On Windows, that means that there cannot be any other process holding an open handle to
said files, or even just a mapped region.
So let's make sure that git diff itself is not holding any open handle to the files in question.
In fact, we will just release the file pair right away, as the external diff uses the files we just wrote, so we do not need to hold the file contents in memory anymore.
This fixes git-for-windows#1315
运行“git diff”(man),同时允许外部diff处于未合并路径的状态,用于段错误,这已在git 2.30 (Q1 2021)中得到纠正。
参见Jinoh Kang (iamahuman)的commit d668518, commit 2469593(2020年11月6日)。
(由Junio C Hamano - gitster -在commit d5e3532中合并,2020年11月21日)
diff:允许传入NULL到diff_free_filespec_data()
签署人:Jinoh Kang
署名:Junio C Hamano
Commit 3aef54e8b8(“diff: munmap()文件内容在运行外部diff之前”,Git v2.22.1)引入了对run_external_diff中的diff_free_filespec_data的调用,该调用可能传递NULL指针。
通过将diff_free_filespec_data(NULL)设置为no-op来修复此问题并防止将来出现任何此类错误。
修复:3aef54e8b8(“diff: munmap()文件内容在运行外部diff之前”)