Branch: refs/heads/master
Home: https://github.com/phpmyadmin/scripts
Commit: eb3d273d29c3feb4d79c2daee60bed594bb6e571
https://github.com/phpmyadmin/scripts/commit/eb3d273d29c3feb4d79c2daee60bed594bb6e571
Author: William Desportes <[email protected]>
Date: 2026-09-13 (Sun, 09 September 2026) +02:00

Changed paths: 
M demo/bin/pma-demo-build

Log Message:
-----------
demo: fix the worktree cleanup crashing on stale entries

The cleanup removes every worktree that no longer matches a variant but it
iterated over `git worktree list`, which also returns the worktrees whose
directory is already gone. The release step `rm -rf`s the
release/phpMyAdmin-6.0.0-dev worktree without unregistering it, so the next
run listed it again and ran `rm -r` on a missing path, aborting the whole
script with `rm: cannot remove ...: No such file or directory` under set -e.

Prune before listing so the dead registrations are already forgotten, and
prune again after each removal so a delete done outside git still drops the
registration and the error cannot come back on the following run.

A linked worktree has a .git file and not a .git directory, so the -d test
sent all of them to the plain rm branch; test with -e and let
`git worktree remove --force` handle them. The force flag keeps the
unattended script from stopping on a worktree with local changes, which is
what the plain rm it replaces used to do.

The list is now parsed with awk: `grep -F worktree` also matched the
neighbouring lines of the bare/prunable entries and cut split on any space,
truncating a path that contains one.

Co-Authored-By: DeepSeek <[email protected]>

_______________________________________________
Git mailing list -- [email protected]
To unsubscribe send an email to [email protected]

Reply via email to