@feigi/fleet-ctl 3.30.4 → 3.30.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/package.json +1 -1
- package/scripts/reap.sh +4 -3
- package/scripts/release-ticket.sh +3 -2
- package/scripts/worktree.sh +11 -3
package/package.json
CHANGED
package/scripts/reap.sh
CHANGED
|
@@ -1108,9 +1108,10 @@ for b in $gone_branches; do
|
|
|
1108
1108
|
# along, the same cwd deletion this guard exists for, one path further
|
|
1109
1109
|
# out — even though `$wt` itself never equals `$self_wt` in that shape.
|
|
1110
1110
|
# worktree.sh's `wt_holds_cwd` carries the match and why it is on the
|
|
1111
|
-
# directory, not only the string
|
|
1111
|
+
# directory, not only the string; a compare it could not make comes back
|
|
1112
|
+
# in `$wt_why`, reported in place of the match this wording claims.
|
|
1112
1113
|
if wt_holds_cwd "$wt" "$self_wt"; then
|
|
1113
|
-
keep "$b" "worktree $wt holds the working directory this run was started in — removing it would delete the cwd every git call after it needs; rerun from outside it"
|
|
1114
|
+
keep "$b" "${wt_why:-worktree $wt holds the working directory this run was started in — removing it would delete the cwd every git call after it needs; rerun from outside it}"
|
|
1114
1115
|
continue
|
|
1115
1116
|
fi
|
|
1116
1117
|
|
|
@@ -1550,7 +1551,7 @@ else
|
|
|
1550
1551
|
# sweep's copy of this guard: a worktree nested inside `$wt` is removed
|
|
1551
1552
|
# along with it even though `$wt` never equals `$self_wt` in that shape.
|
|
1552
1553
|
if wt_holds_cwd "$wt" "$self_wt"; then
|
|
1553
|
-
keep "" "worktree $wt holds the working directory this run was started in — removing it would delete the cwd every git call after it needs; rerun from outside it"
|
|
1554
|
+
keep "" "${wt_why:-worktree $wt holds the working directory this run was started in — removing it would delete the cwd every git call after it needs; rerun from outside it}"
|
|
1554
1555
|
continue
|
|
1555
1556
|
fi
|
|
1556
1557
|
|
|
@@ -1182,7 +1182,8 @@ fi
|
|
|
1182
1182
|
# under it, after which every git call dies with `fatal: Unable to read current
|
|
1183
1183
|
# working directory` (measured on reap.sh, whose sweeps refuse the same path).
|
|
1184
1184
|
# Asked of the directory, not the string, by worktree.sh's `wt_holds_cwd`,
|
|
1185
|
-
# which also answers true when `[` cannot evaluate the compare
|
|
1185
|
+
# which also answers true when `[` cannot evaluate the compare, naming that
|
|
1186
|
+
# fault in `$wt_why`, reported in place of the match. `pwd -P`, not
|
|
1186
1187
|
# `$PWD`: an inherited `PWD` naming some other directory is one POSIX leaves
|
|
1187
1188
|
# the shell free to keep. The sentinel keeps a trailing newline in the path.
|
|
1188
1189
|
# A blocker, not a die: what stands in the way is known, and one `cd` away.
|
|
@@ -1191,7 +1192,7 @@ if [ -n "$wt" ]; then
|
|
|
1191
1192
|
die "cannot read the working directory this run was started in, so whether releasing $wt would delete it is unknown"
|
|
1192
1193
|
rt_cwd=${rt_cwd%?x}
|
|
1193
1194
|
if wt_holds_cwd "$wt" "$rt_cwd"; then
|
|
1194
|
-
block "worktree $wt holds the working directory this run was started in — removing it would delete the cwd every git call after it needs; rerun from outside it"
|
|
1195
|
+
block "${wt_why:-worktree $wt holds the working directory this run was started in — removing it would delete the cwd every git call after it needs; rerun from outside it}"
|
|
1195
1196
|
fi
|
|
1196
1197
|
fi
|
|
1197
1198
|
|
package/scripts/worktree.sh
CHANGED
|
@@ -994,14 +994,22 @@ EOF
|
|
|
994
994
|
# Nothing downstream of this guard re-checks the directory it protects, so
|
|
995
995
|
# reading that rc as "not this one" would disable the guard silently.
|
|
996
996
|
#
|
|
997
|
-
# Returns 0 or 1 only, and
|
|
998
|
-
# because only the caller knows whose cwd $2 is.
|
|
997
|
+
# Returns 0 or 1 only. A match, and every 1, leave `$wt_why` empty: the caller
|
|
998
|
+
# names that refusal, because only the caller knows whose cwd $2 is. The
|
|
999
|
+
# fail-closed 0 instead sets `$wt_why` to the compare that could not be made,
|
|
1000
|
+
# and the caller reports that in place of its own wording, which would claim
|
|
1001
|
+
# a match nothing established. Cleared on entry, so a reason left by an
|
|
1002
|
+
# earlier probe never stands in for a match.
|
|
999
1003
|
wt_holds_cwd() {
|
|
1004
|
+
wt_why=
|
|
1000
1005
|
wt_hc_d=$2
|
|
1001
1006
|
while :; do
|
|
1002
1007
|
# shellcheck disable=SC3013,SC2319 # -ef as in wt_linkage; the else's $? is the `[ -ef ]` test's own rc, read before anything else runs, to fail closed on rc>=2
|
|
1003
1008
|
if [ "$wt_hc_d" -ef "$1" ]; then return 0; else wt_hc_rc=$?; fi
|
|
1004
|
-
[ "$wt_hc_rc" -
|
|
1009
|
+
if [ "$wt_hc_rc" -ge 2 ]; then
|
|
1010
|
+
wt_why="could not compare $wt_hc_d with $1 (test -ef exited $wt_hc_rc), so whether removing $1 would delete the working directory is unknown"
|
|
1011
|
+
return 0
|
|
1012
|
+
fi
|
|
1005
1013
|
case "$wt_hc_d" in
|
|
1006
1014
|
*/*) wt_hc_d=${wt_hc_d%/*} ;;
|
|
1007
1015
|
*) return 1 ;;
|