V2EX = way to explore
V2EX 是一个关于分享和探索的地方
Sign Up Now
For Existing Member  Sign In
AndyAO
V2EX  ›  问与答

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

  •  1
     
  •   AndyAO · May 31, 2021 · 553 views
    This topic created in 1794 days ago, the information mentioned may be changed or developed.

    从下面的测试可以看到,即使已经提前设置了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
        }
    }
    
    No Comments Yet
    About   ·   Help   ·   Advertise   ·   Blog   ·   API   ·   FAQ   ·   Solana   ·   5616 Online   Highest 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 29ms · UTC 01:32 · PVG 09:32 · LAX 18:32 · JFK 21:32
    ♥ Do have faith in what you're doing.