3 if ! test_have_prereq PERL
; then
4 say
'skipping --patch tests, perl not available'
15 noslash
="$(echo "$1" | tr / _)" &&
16 cat "$1" > _worktree_
"$noslash" &&
17 git show
:"$1" > _index_
"$noslash"
20 set_and_save_state
() {
26 test "$(cat "$1")" = "$2" &&
27 test "$(git show :"$1")" = "$3"
30 verify_saved_state
() {
31 noslash
="$(echo "$1" | tr / _)" &&
32 verify_state
"$1" "$(cat _worktree_"$noslash")" "$(cat _index_"$noslash")"
36 git rev-parse HEAD
> _head
39 verify_saved_head
() {
40 test "$(cat _head)" = "$(git rev-parse HEAD)"