(command.CommandList
  children: [
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:test_description)
          op: assign_op.Equal
          rhs: {(SQ <'utf-8 decomposed (nfd) converted to precomposed (nfc)'>)}
          spids: [13]
        )
      ]
    )
    (C {<.>} {<'./test-lib.sh'>})
    (command.If
      arms: [
        (if_arm
          cond: 
            (condition.Shell
              commands: [
                (command.Pipeline
                  children: [(C {<test_have_prereq>} {<UTF8_NFD_TO_NFC>})]
                  negated: T
                )
              ]
            )
          action: [
            (command.ShAssignment
              pairs: [
                (assign_pair
                  lhs: (sh_lhs_expr.Name name:skip_all)
                  op: assign_op.Equal
                  rhs: {(DQ <'filesystem does not corrupt utf-8'>)}
                  spids: [35]
                )
              ]
            )
            (C {<test_done>})
          ]
          spids: [24 32]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:Adiarnfc)
          op: assign_op.Equal
          rhs: 
            {
              (command_sub
                left_token: <Id.Left_DollarParen '$('>
                child: (C {<printf>} {(SQ <'\\303\\204'>)})
              )
            }
          spids: [49]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:Adiarnfd)
          op: assign_op.Equal
          rhs: 
            {
              (command_sub
                left_token: <Id.Left_DollarParen '$('>
                child: (C {<printf>} {(SQ <'A\\314\\210'>)})
              )
            }
          spids: [58]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:Odiarnfc)
          op: assign_op.Equal
          rhs: 
            {
              (command_sub
                left_token: <Id.Left_DollarParen '$('>
                child: (C {<printf>} {(SQ <'\\303\\226'>)})
              )
            }
          spids: [68]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:Odiarnfd)
          op: assign_op.Equal
          rhs: 
            {
              (command_sub
                left_token: <Id.Left_DollarParen '$('>
                child: (C {<printf>} {(SQ <'O\\314\\210'>)})
              )
            }
          spids: [77]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:AEligatu)
          op: assign_op.Equal
          rhs: 
            {
              (command_sub
                left_token: <Id.Left_DollarParen '$('>
                child: (C {<printf>} {(SQ <'\\303\\206'>)})
              )
            }
          spids: [86]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:Invalidu)
          op: assign_op.Equal
          rhs: 
            {
              (command_sub
                left_token: <Id.Left_DollarParen '$('>
                child: (C {<printf>} {(SQ <'\\303\\377'>)})
              )
            }
          spids: [95]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:Alongd)
          op: assign_op.Equal
          rhs: 
            {($ Id.VSub_DollarName '$Adiarnfd') ($ Id.VSub_DollarName '$Adiarnfd') 
              ($ Id.VSub_DollarName '$Adiarnfd') ($ Id.VSub_DollarName '$Adiarnfd') ($ Id.VSub_DollarName '$Adiarnfd') 
              ($ Id.VSub_DollarName '$Adiarnfd') ($ Id.VSub_DollarName '$Adiarnfd')
            }
          spids: [109]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:Alongd)
          op: assign_op.Equal
          rhs: 
            {($ Id.VSub_DollarName '$Alongd') ($ Id.VSub_DollarName '$Alongd') 
              ($ Id.VSub_DollarName '$Alongd')
            }
          spids: [121]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:Alongd)
          op: assign_op.Equal
          rhs: 
            {($ Id.VSub_DollarName '$Alongd') ($ Id.VSub_DollarName '$Alongd') 
              ($ Id.VSub_DollarName '$Alongd') ($ Id.VSub_DollarName '$Alongd') ($ Id.VSub_DollarName '$Adiarnfd')
            }
          spids: [129]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:Alongc)
          op: assign_op.Equal
          rhs: 
            {($ Id.VSub_DollarName '$AEligatu') ($ Id.VSub_DollarName '$AEligatu') 
              ($ Id.VSub_DollarName '$AEligatu') ($ Id.VSub_DollarName '$AEligatu') ($ Id.VSub_DollarName '$AEligatu')
            }
          spids: [143]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:Alongc)
          op: assign_op.Equal
          rhs: 
            {($ Id.VSub_DollarName '$Alongc') ($ Id.VSub_DollarName '$Alongc') 
              ($ Id.VSub_DollarName '$Alongc') ($ Id.VSub_DollarName '$Alongc') ($ Id.VSub_DollarName '$Alongc')
            }
          spids: [153]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:Alongc)
          op: assign_op.Equal
          rhs: 
            {($ Id.VSub_DollarName '$Alongc') ($ Id.VSub_DollarName '$Alongc') 
              ($ Id.VSub_DollarName '$Alongc') ($ Id.VSub_DollarName '$Alongc') ($ Id.VSub_DollarName '$Alongc')
            }
          spids: [163]
        )
      ]
    )
    (command.ShAssignment
      pairs: [
        (assign_pair
          lhs: (sh_lhs_expr.Name name:Alongc)
          op: assign_op.Equal
          rhs: 
            {($ Id.VSub_DollarName '$Alongc') ($ Id.VSub_DollarName '$AEligatu') 
              ($ Id.VSub_DollarName '$AEligatu')
            }
          spids: [173]
        )
      ]
    )
    (C {<test_expect_success>} {(DQ <'detect if nfd needed'>)} 
      {
        (SQ <'\n'> <'\tprecomposeunicode=$(git config core.precomposeunicode) &&\n'> 
          <'\ttest "$precomposeunicode" = true &&\n'> <'\tgit config core.precomposeunicode true\n'>
        )
      }
    )
    (C {<test_expect_success>} {(DQ <setup>)} 
      {
        (SQ <'\n'> <'\t>x &&\n'> <'\tgit add x &&\n'> <'\tgit commit -m "1st commit" &&\n'> 
          <'\tgit rm x &&\n'> <'\tgit commit -m "rm x"\n'>
        )
      }
    )
    (C {<test_expect_success>} {(DQ <'setup case mac'>)} {(SQ <'\n'> <'\tgit checkout -b mac_os\n'>)})
    (C {<test_expect_success>} {(DQ <'git diff f.Adiar'>)} 
      {
        (SQ <'\n'> <'\ttouch f.$Adiarnfc &&\n'> <'\tgit add f.$Adiarnfc &&\n'> 
          <'\techo f.Adiarnfc >f.$Adiarnfc &&\n'> <'\tgit diff f.$Adiarnfd >expect &&\n'> <'\tgit diff f.$Adiarnfc >actual &&\n'> 
          <'\ttest_cmp expect actual &&\n'> <'\tgit reset HEAD f.Adiarnfc &&\n'> <'\trm f.$Adiarnfc expect actual\n'>
        )
      }
    )
    (C {<test_expect_success>} {(DQ <'git diff-files f.Adiar'>)} 
      {
        (SQ <'\n'> <'\ttouch f.$Adiarnfc &&\n'> <'\tgit add f.$Adiarnfc &&\n'> 
          <'\techo f.Adiarnfc >f.$Adiarnfc &&\n'> <'\tgit diff-files f.$Adiarnfd >expect &&\n'> <'\tgit diff-files f.$Adiarnfc >actual &&\n'> 
          <'\ttest_cmp expect actual &&\n'> <'\tgit reset HEAD f.Adiarnfc &&\n'> <'\trm f.$Adiarnfc expect actual\n'>
        )
      }
    )
    (C {<test_expect_success>} {(DQ <'git diff-index f.Adiar'>)} 
      {
        (SQ <'\n'> <'\ttouch f.$Adiarnfc &&\n'> <'\tgit add f.$Adiarnfc &&\n'> 
          <'\techo f.Adiarnfc >f.$Adiarnfc &&\n'> <'\tgit diff-index HEAD f.$Adiarnfd >expect &&\n'> <'\tgit diff-index HEAD f.$Adiarnfc >actual &&\n'> 
          <'\ttest_cmp expect actual &&\n'> <'\tgit reset HEAD f.Adiarnfc &&\n'> <'\trm f.$Adiarnfc expect actual\n'>
        )
      }
    )
    (C {<test_expect_success>} {(DQ <'add file Adiarnfc'>)} 
      {
        (SQ <'\n'> <'\techo f.Adiarnfc >f.$Adiarnfc &&\n'> <'\tgit add f.$Adiarnfc &&\n'> 
          <'\tgit commit -m "add f.$Adiarnfc"\n'>
        )
      }
    )
    (C {<test_expect_success>} {(DQ <'git diff-tree f.Adiar'>)} 
      {
        (SQ <'\n'> <'\techo f.Adiarnfc >>f.$Adiarnfc &&\n'> 
          <'\tgit diff-tree HEAD f.$Adiarnfd >expect &&\n'> <'\tgit diff-tree HEAD f.$Adiarnfc >actual &&\n'> <'\ttest_cmp expect actual &&\n'> 
          <'\tgit checkout f.$Adiarnfc &&\n'> <'\trm expect actual\n'>
        )
      }
    )
    (C {<test_expect_success>} {(DQ <'stage file d.Adiarnfd/f.Adiarnfd'>)} 
      {
        (SQ <'\n'> <'\tmkdir d.$Adiarnfd &&\n'> 
          <'\techo d.$Adiarnfd/f.$Adiarnfd >d.$Adiarnfd/f.$Adiarnfd &&\n'> <'\tgit stage d.$Adiarnfd/f.$Adiarnfd &&\n'> <'\tgit commit -m "add d.$Adiarnfd/f.$Adiarnfd"\n'>
        )
      }
    )
    (C {<test_expect_success>} {(DQ <'add link Adiarnfc'>)} 
      {
        (SQ <'\n'> <'\tln -s d.$Adiarnfd/f.$Adiarnfd l.$Adiarnfc &&\n'> <'\tgit add l.$Adiarnfc &&\n'> 
          <'\tgit commit -m "add l.Adiarnfc"\n'>
        )
      }
    )
    (C {<test_expect_success>} {(DQ <'git log f.Adiar'>)} 
      {
        (SQ <'\n'> <'\tgit log f.$Adiarnfc > f.Adiarnfc.log &&\n'> 
          <'\tgit log f.$Adiarnfd > f.Adiarnfd.log &&\n'> <'\ttest -s f.Adiarnfc.log &&\n'> <'\ttest -s f.Adiarnfd.log &&\n'> 
          <'\ttest_cmp f.Adiarnfc.log f.Adiarnfd.log &&\n'> <'\trm f.Adiarnfc.log f.Adiarnfd.log\n'>
        )
      }
    )
    (C {<test_expect_success>} {(DQ <'git lsfiles f.Adiar'>)} 
      {
        (SQ <'\n'> <'\tgit ls-files f.$Adiarnfc > f.Adiarnfc.log &&\n'> 
          <'\tgit ls-files f.$Adiarnfd > f.Adiarnfd.log &&\n'> <'\ttest -s f.Adiarnfc.log &&\n'> <'\ttest -s f.Adiarnfd.log &&\n'> 
          <'\ttest_cmp f.Adiarnfc.log f.Adiarnfd.log &&\n'> <'\trm f.Adiarnfc.log f.Adiarnfd.log\n'>
        )
      }
    )
    (C {<test_expect_success>} {(DQ <'git mv'>)} 
      {
        (SQ <'\n'> <'\tgit mv f.$Adiarnfd f.$Odiarnfc &&\n'> <'\tgit mv d.$Adiarnfd d.$Odiarnfc &&\n'> 
          <'\tgit mv l.$Adiarnfd l.$Odiarnfc &&\n'> <'\tgit commit -m "mv Adiarnfd Odiarnfc"\n'>
        )
      }
    )
    (C {<test_expect_success>} {(DQ <'git checkout nfc'>)} 
      {(SQ <'\n'> <'\trm f.$Odiarnfc &&\n'> <'\tgit checkout f.$Odiarnfc\n'>)}
    )
    (C {<test_expect_success>} {(DQ <'git checkout file nfd'>)} 
      {(SQ <'\n'> <'\trm -f f.* &&\n'> <'\tgit checkout f.$Odiarnfd\n'>)}
    )
    (C {<test_expect_success>} {(DQ <'git checkout link nfd'>)} 
      {(SQ <'\n'> <'\trm l.* &&\n'> <'\tgit checkout l.$Odiarnfd\n'>)}
    )
    (C {<test_expect_success>} {(DQ <'setup case mac2'>)} 
      {
        (SQ <'\n'> <'\tgit checkout master &&\n'> <'\tgit reset --hard &&\n'> 
          <'\tgit checkout -b mac_os_2\n'>
        )
      }
    )
    (C {<test_expect_success>} {(DQ <'commit file d2.Adiarnfd/f.Adiarnfd'>)} 
      {
        (SQ <'\n'> <'\tmkdir d2.$Adiarnfd &&\n'> 
          <'\techo d2.$Adiarnfd/f.$Adiarnfd >d2.$Adiarnfd/f.$Adiarnfd &&\n'> <'\tgit add d2.$Adiarnfd/f.$Adiarnfd &&\n'> 
          <'\tgit commit -m "add d2.$Adiarnfd/f.$Adiarnfd" -- d2.$Adiarnfd/f.$Adiarnfd\n'>
        )
      }
    )
    (C {<test_expect_success>} {(DQ <'setup for long decomposed filename'>)} 
      {
        (SQ <'\n'> <'\tgit checkout master &&\n'> <'\tgit reset --hard &&\n'> 
          <'\tgit checkout -b mac_os_long_nfd_fn\n'>
        )
      }
    )
    (C {<test_expect_success>} {(DQ <'Add long decomposed filename'>)} 
      {
        (SQ <'\n'> <'\techo longd >$Alongd &&\n'> <'\tgit add * &&\n'> 
          <'\tgit commit -m "Long filename"\n'>
        )
      }
    )
    (C {<test_expect_success>} {(DQ <'setup for long precomposed filename'>)} 
      {
        (SQ <'\n'> <'\tgit checkout master &&\n'> <'\tgit reset --hard &&\n'> 
          <'\tgit checkout -b mac_os_long_nfc_fn\n'>
        )
      }
    )
    (C {<test_expect_success>} {(DQ <'Add long precomposed filename'>)} 
      {
        (SQ <'\n'> <'\techo longc >$Alongc &&\n'> <'\tgit add * &&\n'> 
          <'\tgit commit -m "Long filename"\n'>
        )
      }
    )
    (C {<test_expect_failure>} {(SQ <'handle existing decomposed filenames'>)} 
      {
        (SQ <'\n'> <'\techo content >"verbatim.$Adiarnfd" &&\n'> 
          <'\tgit -c core.precomposeunicode=false add "verbatim.$Adiarnfd" &&\n'> <'\tgit commit -m "existing decomposed file" &&\n'> <'\t>expect &&\n'> 
          <'\tgit ls-files --exclude-standard -o "verbatim*" >untracked &&\n'> <'\ttest_cmp expect untracked\n'>
        )
      }
    )
    (C {<test_expect_success>} {(DQ <'respect git config --global core.precomposeunicode'>)} 
      {
        (SQ <'\n'> <'\tgit config --global core.precomposeunicode true &&\n'> <'\trm -rf .git &&\n'> 
          <'\tgit init &&\n'> <'\tprecomposeunicode=$(git config core.precomposeunicode) &&\n'> 
          <'\ttest "$precomposeunicode" = "true"\n'>
        )
      }
    )
    (C {<test_done>})
  ]
)