987
then
988
test_must_be_empty actual
989
else
990
- grep "$info_text" actual
990
+ test_grep "$info_text" actual
991
fi
992
elif [ "$outcome" = "no_infer" ]
993
then
996
then
997
test_must_be_empty actual
998
else
999
- ! grep "$info_text" actual
999
+ test_grep ! "$info_text" actual
1000
fi
1001
elif [ "$outcome" = "fetch_error" ]
1002
then
1003
test_must_fail git $dashc_args worktree add $args 2>actual &&
1004
- grep "$fetch_error_text" actual
1004
+ test_grep "$fetch_error_text" actual
1005
elif [ "$outcome" = "fatal_orphan_bad_combo" ]
1006
then
1007
test_must_fail git $dashc_args worktree add $args 2>actual &&
1008
if [ $use_quiet -eq 1 ]
1009
then
1010
- ! grep "$info_text" actual
1010
+ test_grep ! "$info_text" actual
1011
else
1012
- grep "$info_text" actual
1012
+ test_grep "$info_text" actual
1013
fi &&
1014
- grep "$bad_combo_regex" actual
1014
+ test_grep "$bad_combo_regex" actual
1015
elif [ "$outcome" = "warn_bad_head" ]
1016
then
1017
test_must_fail git $dashc_args worktree add $args 2>actual &&
1018
if [ $use_quiet -eq 1 ]
1019
then
1020
- grep "$invalid_ref_regex" actual &&
1021
- ! grep "$orphan_hint" actual
1020
+ test_grep "$invalid_ref_regex" actual &&
1021
+ test_grep ! "$orphan_hint" actual
1022
else
1023
- headpath=$(git $dashc_args rev-parse --path-format=absolute --git-path HEAD) &&
1024
- headcontents=$(cat "$headpath") &&
1025
- grep "HEAD points to an invalid (or orphaned) reference" actual &&
1026
- grep "HEAD path: .$headpath." actual &&
1027
- grep "HEAD contents: .$headcontents." actual &&
1028
- grep "$orphan_hint" actual &&
1029
- ! grep "$info_text" actual
1023
+ test_grep "HEAD points to an invalid (or orphaned) reference" actual &&
1024
+ test_grep "$orphan_hint" actual &&
1025
+ test_grep ! "$info_text" actual
1026
fi &&
1031
- grep "$invalid_ref_regex" actual
1027
+ test_grep "$invalid_ref_regex" actual
1028
else
1029
# Unreachable
1030
false