File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 196196if [ "${1:-}" = return ] && [ -n "${FM_EXPECT_CHECKOUT_LOCK_ROOT:-}" ]; then
197197 lock_owner=${FM_PROCESS_TREE_GUARD_FILE%/process-group}
198198 [ -d "$lock_owner" ] && [ ! -L "$lock_owner" ] || exit 91
199+ lock_owner=$(cd "$lock_owner" 2>/dev/null && pwd -P) || exit 91
199200 lock_owner_parent=$(cd "$(dirname "$lock_owner")" 2>/dev/null && pwd -P) || exit 91
200201 expected_lock_root=$(cd "$FM_EXPECT_CHECKOUT_LOCK_ROOT" 2>/dev/null && pwd -P) || exit 91
201202 [ "$lock_owner_parent" = "$expected_lock_root" ] || exit 91
@@ -206,7 +207,13 @@ if [ "${1:-}" = return ] && [ -n "${FM_EXPECT_CHECKOUT_LOCK_ROOT:-}" ]; then
206207 lock_link=
207208 for candidate in "$expected_lock_root"/*.lock; do
208209 [ -L "$candidate" ] || continue
209- [ "$(readlink "$candidate" 2>/dev/null)" = "$lock_owner" ] || continue
210+ candidate_owner=$(readlink "$candidate" 2>/dev/null) || continue
211+ case "$candidate_owner" in
212+ /*) ;;
213+ *) candidate_owner=$(dirname "$candidate")/$candidate_owner ;;
214+ esac
215+ candidate_owner=$(cd "$candidate_owner" 2>/dev/null && pwd -P) || continue
216+ [ "$candidate_owner" = "$lock_owner" ] || continue
210217 lock_link=$candidate
211218 break
212219 done
You can’t perform that action at this time.
0 commit comments