You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Commit 53fbf8a
Browse filesBrowse the repository at this point in the historyBrowse files
case "$gi" in .gitignore|*/.gitignore) ;; *) continue ;; esac
109
+
mkdir -p "$sandbox/$(dirname "$gi")"
110
+
git show "$HEAD_SHA:$gi" > "$sandbox/$gi" \
111
+
|| die "Cannot read $gi at $HEAD_SHA. Refusing to pass without having checked."
112
+
done < "$work/tree"
113
+
114
+
# --raw -z emits ":<modes> <shas> <status>" and the path as two separate
115
+
# NUL-terminated records, so read them in pairs.
116
+
while IFS= read -r -d '' meta && IFS= read -r -d '' path; do
117
+
mode=$(printf '%s' "$meta" | awk '{print $2}')
118
+
# A tracked directory is normal; only blobs and symlinks land at a path.
119
+
case "$mode" in 040000|000000) continue ;; esac
120
+
121
+
# Hole test, decided by git's own matcher rather than pattern parsing,
122
+
# so negations, nesting and precedence are handled for free: children
123
+
# of the path are ignored, the path itself is not. check-ignore uses
124
+
# lstat, so a symlink to a real directory still reads as "not a dir".
125
+
if ! ignored "$path" && ignored "$path/__probe__"; then
126
+
kind="file"
127
+
if [ "$mode" = "120000" ]; then
128
+
t=$(git show "$HEAD_SHA:$path") \
129
+
|| die "Cannot read the symlink target of $path at $HEAD_SHA."
130
+
kind="symlink -> $t"
131
+
fi
132
+
printf '%s\n' "::error file=$(esc_prop "$path")::$(esc "Tracking '$path' ($kind) will DELETE the ignored directory of the same name when this is merged or checked out — its contents are gitignored but the path itself is not.")"
133
+
fail=1
134
+
fi
135
+
136
+
# Independent rule: a tracked symlink must not escape the worktree.
137
+
if [ "$mode" = "120000" ]; then
138
+
target=$(git show "$HEAD_SHA:$path") \
139
+
|| die "Cannot read the symlink target of $path at $HEAD_SHA."
140
+
# normpath is pure string work: it must not resolve against the
0 commit comments