Skip to content

Commit abbcd54

Browse files
pks-tgitster
authored andcommitted
t9902: fix use of read with set -e
In t9902 we're using the `read` builtin to read some values into a variable. This is done by using `-d ""`, which cause us to read until the end of the heredoc. There is a gotcha though: when the delimiter isn't found at all, then the read builtin will return an error. This hasn't been an issue until now as we didn't run with `set -e`, but that'll change in a subsequent commit. Prepare for this change by silencing the error. Signed-off-by: Patrick Steinhardt <ps@pks.im> Signed-off-by: Junio C Hamano <gitster@pobox.com>
1 parent 657e0ce commit abbcd54

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

t/t9902-completion.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -590,7 +590,7 @@ test_expect_success '__gitcomp - doesnt fail because of invalid variable name' '
590590
__gitcomp "$invalid_variable_name"
591591
'
592592

593-
read -r -d "" refs <<-\EOF
593+
read -r -d "" refs <<-\EOF || :
594594
main
595595
maint
596596
next

0 commit comments

Comments
 (0)