4 ms·
It's actually equivalent to if test; then commit || revert else revert fi Or in another language: try { test commit } catch { r
by mikelward 8y ago
It's actually equivalent to
if test; then
commit || revert
else
revert
fi
Or in another language:
try {
test
commit
} catch {
revert
}
This is because
test && commit
is evaluated, and the resulting value is the left side of
expr || revert
Not sure if that was intentional, but it's a very nice one liner assuming either your commit never fails, or your commit runs extra tests, and you want to revert if those fail.