3 test_description
='checkout should leave clean stat info'
5 GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
=main
6 export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
8 TEST_PASSES_SANITIZE_LEAK
=true
11 test_expect_success
'setup' '
14 git update-index --add world &&
15 git commit -m initial &&
17 echo goodbye >world &&
18 git update-index --add world &&
23 test_expect_success
'branch switching' '
26 test "$(git diff-files --raw)" = "" &&
29 test "$(git diff-files --raw)" = "" &&
32 test "$(git diff-files --raw)" = "" &&
35 test "$(git diff-files --raw)" = ""
39 test_expect_success
'path checkout' '
42 test "$(git diff-files --raw)" = "" &&
44 git checkout main world &&
45 test "$(git diff-files --raw)" = "" &&
47 git checkout side world &&
48 test "$(git diff-files --raw)" = "" &&
50 git checkout main world &&
51 test "$(git diff-files --raw)" = ""