为什么将 Git 的 status.renames 设为 true 之后仍然不能在 git status 中看到 ORIG_PATH?

2021 年 5 月 31 日
 AndyAO

从下面的测试可以看到,即使已经提前设置了git config status.renames true,输出信息中仍然没有包含 ORIG_PATH 相关信息,根据文档,信息格式应该是XY ORIG_PATH -> PATH才对。

Describe rename {
    BeforeAll {
        function check {
            'abc'>'README.md'
            git add 'README.md'
            git commit -m 'README'
            Rename-Item -Path 'README.md' -NewName 'new.md'
            git status new.md -s | Should -Be '?? new.md'
            git add .
            git status new.md -s | Should -Be 'A  new.md'
        }
    }
    BeforeEach {
        ClearGitRepo
        InitGitRepo
    }
    it 'default' {
        check
    }
    it 'change configuration file' {
        git config status.renames true
        git config diff.renames true
        check
    }
}
554 次点击
所在节点    问与答
0 条回复

这是一个专为移动设备优化的页面(即为了让你能够在 Google 搜索结果里秒开这个页面),如果你希望参与 V2EX 社区的讨论,你可以继续到 V2EX 上打开本讨论主题的完整版本。

https://www.v2ex.com/t/780234

V2EX 是创意工作者们的社区,是一个分享自己正在做的有趣事物、交流想法,可以遇见新朋友甚至新机会的地方。

V2EX is a community of developers, designers and creative people.

© 2021 V2EX