为什么 macOS 12.5 中的 linux 源代码库会自动修改

为什么 macOS 12.5 中的 linux 源代码库会自动修改

我正在使用此命令在 macOS 12.5 中克隆 linux 存储库:

git clone https://github.com/torvalds/linux.git

但是当我使用 git status 显示存储库信息时,存储库有一些修改的文件:

➜  linux git:(master) ✗ git status
On branch master
Your branch is up to date with 'origin/master'.

Changes not staged for commit:
  (use "git add <file>..." to update what will be committed)
  (use "git restore <file>..." to discard changes in working directory)
    modified:   include/uapi/linux/netfilter/xt_CONNMARK.h
    modified:   include/uapi/linux/netfilter/xt_DSCP.h
    modified:   include/uapi/linux/netfilter/xt_MARK.h
    modified:   include/uapi/linux/netfilter/xt_RATEEST.h
    modified:   include/uapi/linux/netfilter/xt_TCPMSS.h
    modified:   include/uapi/linux/netfilter_ipv4/ipt_ECN.h
    modified:   include/uapi/linux/netfilter_ipv4/ipt_TTL.h
    modified:   include/uapi/linux/netfilter_ipv6/ip6t_HL.h
    modified:   net/netfilter/xt_DSCP.c
    modified:   net/netfilter/xt_HL.c
    modified:   net/netfilter/xt_RATEEST.c
    modified:   net/netfilter/xt_TCPMSS.c
    modified:   tools/memory-model/litmus-tests/Z6.0+pooncelock+poonceLock+pombonce.litmus

no changes added to commit (use "git add" and/or "git commit -a")

我没有修改这个repo的任何文件,为什么git status显示修改过的文件?这是 git diff 显示的一部分:

diff --git a/include/uapi/linux/netfilter/xt_CONNMARK.h b/include/uapi/linux/netfilter/xt_CONNMARK.h
index 36cc956ead1a..41b578ccd03b 100644
--- a/include/uapi/linux/netfilter/xt_CONNMARK.h
+++ b/include/uapi/linux/netfilter/xt_CONNMARK.h
@@ -1,7 +1,37 @@
-/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
-#ifndef _XT_CONNMARK_H_target
-#define _XT_CONNMARK_H_target
+/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
+/* Copyright (C) 2002,2004 MARA Systems AB <https://www.marasystems.com>
+ * by Henrik Nordstrom <[email protected]>
+ */

-#include <linux/netfilter/xt_connmark.h>
+#ifndef _XT_CONNMARK_H
+#define _XT_CONNMARK_H

-#endif /*_XT_CONNMARK_H_target*/
+#include <linux/types.h>
+
+enum {
+       XT_CONNMARK_SET = 0,
+       XT_CONNMARK_SAVE,
+       XT_CONNMARK_RESTORE
:
diff --git a/include/uapi/linux/netfilter/xt_CONNMARK.h b/include/uapi/linux/netfilter/xt_CONNMARK.h
index 36cc956ead1a..41b578ccd03b 100644
--- a/include/uapi/linux/netfilter/xt_CONNMARK.h
+++ b/include/uapi/linux/netfilter/xt_CONNMARK.h
@@ -1,7 +1,37 @@
-/* SPDX-License-Identifier: GPL-2.0 WITH Linux-syscall-note */
-#ifndef _XT_CONNMARK_H_target
-#define _XT_CONNMARK_H_target
+/* SPDX-License-Identifier: GPL-2.0+ WITH Linux-syscall-note */
+/* Copyright (C) 2002,2004 MARA Systems AB <https://www.marasystems.com>
+ * by Henrik Nordstrom <[email protected]>

当我使用此命令时,显示如下错误:

➜  linux git:(master) ✗ git checkout . --
fatal: invalid reference: .

答案1

亲身经历后,我找到了答案!问题似乎是无法在不区分大小写的文件系统上检出存储库。您可以创建一个区分大小写的单独分区,也可以在 Docker 容器中创建。

来源:https://groups.google.com/g/git-users/c/FwG2UefGmeo

相关内容