Re: [PATCH 2/5] ci/lib: allow running in GitHub Actions
- From
Junio C Hamano <gitster@pobox.com>
- Date
- Apr 12, 2020, 22:25 UTC
- Message-ID
- <xmqqeesscpfc.fsf@gitster.c.googlers.com>
- In-Reply-To
- <xmqqimi4cq0v.fsf@gitster.c.googlers.com>
Junio C Hamano <gitster@pobox.com> writes:
> ... Two 'test' before && may yield > success or failure and they may control whether the assignment to > CI_OS_NAME is done or skipped, but I expect that they do not affect > how "set -e" behaves.
Heh, I should just have quoted from
https://pubs.opengroup.org/onlinepubs/9699919799/utilities/V3_chap02.html#tag_18_09
Look for "set -e" where three bullet points are there. The relevant is the second one.
2. The -e setting shall be ignored when executing the compound list following the while, until, if, or elif reserved word, a pipeline beginning with the ! reserved word, or any command of an AND-OR list other than the last.
The test to see what the current value of CI_OS_NAME is is a command of an AND list that is not the last one (the last one being the assignment), so its failure does not allow "set -e" to abort the shell.