Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
bump: patch
---

### Changed

- Internal restructuring, no behavior change.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
bump: patch
---

### Changed

- Internal restructuring, no behavior change.
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
---
bump: patch
---

### Changed

- Internal restructuring, no behavior change.
9 changes: 1 addition & 8 deletions plugins/markdown-format/git-hooks/markdown-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -69,13 +69,6 @@ trust_notice() {
printf '%s\n' "$msg" >&2
}

# staged_gone <path>: 0 at pre-commit when <path> is gone from the work tree and
# the index holds it as a regular file, not a symlink (mode 120000) or a submodule.
staged_gone() {
[[ "$CHECKS_MODE" == pre-commit && ! -e "$1" && ! -L "$1" ]] || return 1
[[ "$(git ls-files -s -- ":(literal)$1" 2>/dev/null)" == 100* ]]
}

candidates=()
while IFS= read -r -d '' f; do
case "$f" in
Expand All @@ -94,7 +87,7 @@ gone=()
for f in "${candidates[@]}"; do
kind=tree
if [[ ! -f "$f" || -L "$f" ]]; then
staged_gone "$f" || continue
checks_staged_gone "$f" || continue
kind=gone
fi
md_config_state "$f" .
Expand Down
9 changes: 1 addition & 8 deletions plugins/powershell-format/git-hooks/powershell-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -73,13 +73,6 @@ find_settings() {
done
}

# staged_gone <path>: 0 at pre-commit when <path> is gone from the work tree and
# the index holds it as a regular file, not a symlink (mode 120000) or a submodule.
staged_gone() {
[[ "$CHECKS_MODE" == pre-commit && ! -e "$1" && ! -L "$1" ]] || return 1
[[ "$(git ls-files -s -- ":(literal)$1" 2>/dev/null)" == 100* ]]
}

# kinds: "tree" runs on the work tree's file; "staged" on its staged content,
# written to $CHECKS_TMP/staged, for a file gone from the work tree.
files=()
Expand All @@ -101,7 +94,7 @@ checks_refuse_config_drift PSScriptAnalyzerSettings.psd1 -- "${candidates[@]}" |
for f in "${candidates[@]}"; do
if [[ -f "$f" && ! -L "$f" ]]; then
kind=tree
elif staged_gone "$f"; then
elif checks_staged_gone "$f"; then
kind=staged
else
continue
Expand Down
9 changes: 1 addition & 8 deletions plugins/ruff-format/git-hooks/ruff-check.sh
Original file line number Diff line number Diff line change
Expand Up @@ -80,13 +80,6 @@ governed() {
done
}

# staged_gone <path>: 0 at pre-commit when <path> is gone from the work tree and
# the index holds it as a regular file, not a symlink (mode 120000) or a submodule.
staged_gone() {
[[ "$CHECKS_MODE" == pre-commit && ! -e "$1" && ! -L "$1" ]] || return 1
[[ "$(git ls-files -s -- ":(literal)$1" 2>/dev/null)" == 100* ]]
}

candidates=()
while IFS= read -r -d '' f; do
case "$f" in
Expand All @@ -104,7 +97,7 @@ for f in "${candidates[@]}"; do
governed "$f" || continue
if [[ -f "$f" && ! -L "$f" ]]; then
files+=("$f")
elif staged_gone "$f"; then
elif checks_staged_gone "$f"; then
gone+=("$f")
fi
done
Expand Down
Loading