Include: setup.inc

Execute (Stage untracked file with magit#stage_file at closed file header):
    call Cd_test_sub()
    Magit
    call Search_file('unstaged')
    call magit#open_close_folding(0)
    call Cursor_position()
    call magit#stage_file()
    call Cd_test()
    let diff=Git_diff('staged', Get_filename())
    call Expect_diff(g:test_script_dir . 'addFile/addFile_' . Get_safe_filename() . '_file_diff.expect', diff)

Execute (Unstage file with magit#stage_file at closed file header):
    call Cd_test_sub()
    Magit
    call Search_file('staged')
    call magit#open_close_folding(0)
    call Cursor_position()
    call magit#stage_file()
    call Cd_test()
    let diff=Git_status(Get_filename())
    call Expect_diff(g:test_script_dir . 'addFile/addFile_' . Get_safe_filename() . '_unstaged_status.expect', diff)

Execute (Stage untracked file with magit#stage_file at file header):
    call Cd_test_sub()
    Magit
    call Search_file('unstaged')
    call magit#open_close_folding(1)
    call Cursor_position()
    call magit#stage_file()
    call Cd_test()
    let diff=Git_diff('staged', Get_filename())
    call Expect_diff(g:test_script_dir . 'addFile/addFile_' . Get_safe_filename() . '_file_diff.expect', diff)

Execute (Unstage file with magit#stage_file at file header):
    call Cd_test_sub()
    Magit
    call Search_file('staged')
    call magit#open_close_folding(1)
    call Cursor_position()
    call magit#stage_file()
    call Cd_test()
    let diff=Git_status(Get_filename())
    call Expect_diff(g:test_script_dir . 'addFile/addFile_' . Get_safe_filename() . '_unstaged_status.expect', diff)

Execute (Stage untracked file with magit#stage_file):
    call Cd_test_sub()
    Magit
    call Search_file('unstaged')
    call magit#open_close_folding(1)
    call Move_relative(+1)
    call Cursor_position()
    call magit#stage_file()
    call Cd_test()
    let diff=Git_diff('staged', Get_filename())
    call Expect_diff(g:test_script_dir . 'addFile/addFile_' . Get_safe_filename() . '_file_diff.expect', diff)

Execute (Unstage file with magit#stage_file):
    call Cd_test_sub()
    Magit
    call Search_file('staged')
    call magit#open_close_folding(1)
    call Move_relative(+1)
    call Cursor_position()
    call magit#stage_file()
    call Cd_test()
    let diff=Git_status(Get_filename())
    call Expect_diff(g:test_script_dir . 'addFile/addFile_' . Get_safe_filename() . '_unstaged_status.expect', diff)

Execute (Stage untracked file with magit#stage_hunk at closed file header):
    call Cd_test_sub()
    Magit
    call Search_file('unstaged')
    call magit#open_close_folding(0)
    call Cursor_position()
    call magit#stage_hunk(0)
    call Cd_test()
    let diff=Git_diff('staged', Get_filename())
    call Expect_diff(g:test_script_dir . 'addFile/addFile_' . Get_safe_filename() . '_file_diff.expect', diff)

Execute (Unstage file with magit#stage_hunk at closed file header):
    call Cd_test_sub()
    Magit
    call Search_file('staged')
    call magit#open_close_folding(0)
    call Cursor_position()
    call magit#stage_hunk(0)
    call Cd_test()
    let diff=Git_status(Get_filename())
    call Expect_diff(g:test_script_dir . 'addFile/addFile_' . Get_safe_filename() . '_unstaged_status.expect', diff)

Execute (Stage untracked file with magit#stage_hunk at file header):
    call Cd_test_sub()
    Magit
    call Search_file('unstaged')
    call magit#open_close_folding(1)
    call Cursor_position()
    call magit#stage_hunk(0)
    call Cd_test()
    let diff=Git_diff('staged', Get_filename())
    call Expect_diff(g:test_script_dir . 'addFile/addFile_' . Get_safe_filename() . '_file_diff.expect', diff)

Execute (Unstage file with magit#stage_hunk at file header):
    call Cd_test_sub()
    Magit
    call Search_file('staged')
    call magit#open_close_folding(1)
    call Cursor_position()
    call magit#stage_hunk(0)
    call Cd_test()
    let diff=Git_status(Get_filename())
    call Expect_diff(g:test_script_dir . 'addFile/addFile_' . Get_safe_filename() . '_unstaged_status.expect', diff)

Execute (Stage untracked file with magit#stage_file at file header):
    call Cd_test_sub()
    Magit
    call Search_file('unstaged')
    call magit#open_close_folding(1)
    call Cursor_position()
    call magit#stage_file()
    call Cd_test()
    let diff=Git_diff('staged', Get_filename())
    call Expect_diff(g:test_script_dir . 'addFile/addFile_' . Get_safe_filename() . '_file_diff.expect', diff)

Execute (Commit file):
    call Cd_test_sub()
    Magit
    call magit#commit_command('CC')
    put =['Add bootstrap file', '', 'Some description text', 'On multiple lines', '', 'With blanks']
    call magit#commit_command('CC')
    call Cd_test()
    let commit_msg=Git_commit_msg('HEAD')
    call Expect_diff(g:test_script_dir . 'addFile/addFile_' . Get_safe_filename() . '_commit.expect', commit_msg)

Include: cleanup.inc
