]>
Commit | Line | Data |
---|---|---|
75336878 DB |
1 | #!/bin/sh |
2 | ||
3 | test_description='checkout should leave clean stat info' | |
4 | ||
883b98ef | 5 | GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main |
334afbc7 JS |
6 | export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME |
7 | ||
9081a421 | 8 | TEST_PASSES_SANITIZE_LEAK=true |
75336878 DB |
9 | . ./test-lib.sh |
10 | ||
11 | test_expect_success 'setup' ' | |
12 | ||
13 | echo hello >world && | |
14 | git update-index --add world && | |
15 | git commit -m initial && | |
16 | git branch side && | |
17 | echo goodbye >world && | |
18 | git update-index --add world && | |
19 | git commit -m second | |
20 | ||
21 | ' | |
22 | ||
23 | test_expect_success 'branch switching' ' | |
24 | ||
25 | git reset --hard && | |
26 | test "$(git diff-files --raw)" = "" && | |
27 | ||
883b98ef | 28 | git checkout main && |
75336878 DB |
29 | test "$(git diff-files --raw)" = "" && |
30 | ||
31 | git checkout side && | |
32 | test "$(git diff-files --raw)" = "" && | |
33 | ||
883b98ef | 34 | git checkout main && |
75336878 DB |
35 | test "$(git diff-files --raw)" = "" |
36 | ||
37 | ' | |
38 | ||
39 | test_expect_success 'path checkout' ' | |
40 | ||
41 | git reset --hard && | |
42 | test "$(git diff-files --raw)" = "" && | |
43 | ||
883b98ef | 44 | git checkout main world && |
75336878 DB |
45 | test "$(git diff-files --raw)" = "" && |
46 | ||
47 | git checkout side world && | |
48 | test "$(git diff-files --raw)" = "" && | |
49 | ||
883b98ef | 50 | git checkout main world && |
75336878 DB |
51 | test "$(git diff-files --raw)" = "" |
52 | ||
53 | ' | |
54 | ||
55 | test_done | |
56 |