Interplane page as plain text, for reading tools and agents. English is the reference text: translate it with your own tool. Text in backticks and in ``` blocks (commands, fingerprints, file names) and link targets in <...> are exact: copy them, never translate them. Page: /drakestapleton/git/blob/master/t/chainlint/nested-loop-detect-failure.test # git [Ported from github.com/git/git] Sync with Git 2.56.1 Brought by drakestapleton Sign in to star 0 stars 0 watching About Files History Releases Proposed changes Issues For developers branch `master` Branches Tags History `git / t / chainlint / nested-loop-detect-failure.test` 37 lines ยท 804 bytes Raw Blame History 1 test_expect_success 'nested-loop-detect-failure' ' 2 # LINT: neither loop handles failure explicitly with "|| return 1" 3 for i in 0 1 2 3 4 5 6 7 8 9; 4 do 5 for j in 0 1 2 3 4 5 6 7 8 9; 6 do 7 echo "$i$j" >"path$i$j" 8 done 9 done && 10 11 # LINT: inner loop handles failure explicitly with "|| return 1" 12 for i in 0 1 2 3 4 5 6 7 8 9; 13 do 14 for j in 0 1 2 3 4 5 6 7 8 9; 15 do 16 echo "$i$j" >"path$i$j" || return 1 17 done 18 done && 19 20 # LINT: outer loop handles failure explicitly with "|| return 1" 21 for i in 0 1 2 3 4 5 6 7 8 9; 22 do 23 for j in 0 1 2 3 4 5 6 7 8 9; 24 do 25 echo "$i$j" >"path$i$j" 26 done || return 1 27 done && 28 29 # LINT: inner & outer loops handles failure explicitly with "|| return 1" 30 for i in 0 1 2 3 4 5 6 7 8 9; 31 do 32 for j in 0 1 2 3 4 5 6 7 8 9; 33 do 34 echo "$i$j" >"path$i$j" || return 1 35 done || return 1 36 done 37 '