首页 > V2EX > V2EX-为什么将 Git 的 status.renames 设为 true 之后仍然不能在 git status 中看到 ORIG_PATH?
2021
05-31

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

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
    }
}

最后编辑:
作者:分享菌
这个作者貌似有点懒,什么都没有留下。

留下一个回复