V2EX = way to explore
V2EX 是一个关于分享和探索的地方
现在注册
已注册用户请  登录
AndyAO
V2EX  ›  问与答

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

  •  1
     
  •   AndyAO · 2021 年 5 月 31 日 · 517 次点击
    这是一个创建于 1774 天前的主题,其中的信息可能已经有所发展或是发生改变。

    从下面的测试可以看到,即使已经提前设置了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
        }
    }
    
    目前尚无回复
    关于   ·   帮助文档   ·   自助推广系统   ·   博客   ·   API   ·   FAQ   ·   Solana   ·   978 人在线   最高记录 6679   ·     Select Language
    创意工作者们的社区
    World is powered by solitude
    VERSION: 3.9.8.5 · 42ms · UTC 22:07 · PVG 06:07 · LAX 15:07 · JFK 18:07
    ♥ Do have faith in what you're doing.