二进制文件和“ * text eol = lf”

时间:2019-09-19 21:05:19

标签: git git-config line-endings

我创建了一个随机的二进制文件:

hp = 100

def test1():
    test = input("yes no")
    if test == "yes":
        print("this is hp test")
        print(hp - 25) # should be 100 - 25 = 75
        test2()

    if test == "no":
        print("ok")
        input("dead end")

def test2():
    test2 = input("yes no")
    if test2 == "yes":
        print("this is second hp test")
        print(hp - 25) # should be 75 - 25 = 50 
    if test2 == "no":
        print("ok")
        input("another dead end")

input("start")
test1()

md5哈希为c4074ec24509750f4278c244426f7ba7,其中包含dd if=/dev/urandom of=random bs=1 count=1024 md5 random 个字符。

我有一个LF文件,

.gitattributes

这意味着每个路径都启用了行尾规范化,并且工作目录签出是* text eol=lf 结尾(LF)。

我的git配置中有eol=lf 并添加并提交了文件:

core.autocrlf = false

相应的blob对象的输出md5哈希值未更改。这是为什么。我期望有一个更改,因为该文件已由git add -A git commit -a -m "first" git show --format=raw $(git ls-files -s random | cut -d " " -f 2) | md5 清楚地标记为文本,并且.gitattributes应该已经对该二进制文件进行了eol标准化(这是无意义的)。 但是为什么什么也没发生?

0 个答案:

没有答案