(CommandList
  children: [
    (Assignment
      keyword: Assign_None
      pairs: [
        (assign_pair
          lhs: (LhsName name:test_description)
          op: Equal
          rhs: {(SQ <"applying patch with mode bits">)}
          spids: [4]
        )
      ]
      spids: [4]
    )
    (C {(.)} {(./test-lib.sh)})
    (C {(test_expect_success)} {(setup)} 
      {
        (SQ <"\n"> <"\techo original >file &&\n"> <"\tgit add file &&\n"> <"\ttest_tick &&\n"> 
          <"\tgit commit -m initial &&\n"> <"\tgit tag initial &&\n"> <"\techo modified >file &&\n"> <"\tgit diff --stat -p >patch-0.txt &&\n"> 
          <"\tchmod +x file &&\n"> <"\tgit diff --stat -p >patch-1.txt\n">
        )
      }
    )
    (C {(test_expect_success)} {(FILEMODE)} {(SQ <"same mode (no index)">)} 
      {
        (SQ <"\n"> <"\tgit reset --hard &&\n"> <"\tchmod +x file &&\n"> <"\tgit apply patch-0.txt &&\n"> 
          <"\ttest -x file\n">
        )
      }
    )
    (C {(test_expect_success)} {(FILEMODE)} {(SQ <"same mode (with index)">)} 
      {
        (SQ <"\n"> <"\tgit reset --hard &&\n"> <"\tchmod +x file &&\n"> <"\tgit add file &&\n"> 
          <"\tgit apply --index patch-0.txt &&\n"> <"\ttest -x file &&\n"> <"\tgit diff --exit-code\n">
        )
      }
    )
    (C {(test_expect_success)} {(FILEMODE)} {(SQ <"same mode (index only)">)} 
      {
        (SQ <"\n"> <"\tgit reset --hard &&\n"> <"\tchmod +x file &&\n"> <"\tgit add file &&\n"> 
          <"\tgit apply --cached patch-0.txt &&\n"> <"\tgit ls-files -s file | grep \"^100755\"\n">
        )
      }
    )
    (C {(test_expect_success)} {(FILEMODE)} {(SQ <"mode update (no index)">)} 
      {(SQ <"\n"> <"\tgit reset --hard &&\n"> <"\tgit apply patch-1.txt &&\n"> <"\ttest -x file\n">)}
    )
    (C {(test_expect_success)} {(FILEMODE)} {(SQ <"mode update (with index)">)} 
      {
        (SQ <"\n"> <"\tgit reset --hard &&\n"> <"\tgit apply --index patch-1.txt &&\n"> 
          <"\ttest -x file &&\n"> <"\tgit diff --exit-code\n">
        )
      }
    )
    (C {(test_expect_success)} {(FILEMODE)} {(SQ <"mode update (index only)">)} 
      {
        (SQ <"\n"> <"\tgit reset --hard &&\n"> <"\tgit apply --cached patch-1.txt &&\n"> 
          <"\tgit ls-files -s file | grep \"^100755\"\n">
        )
      }
    )
    (C {(test_done)})
  ]
)