]> git.ipfire.org Git - thirdparty/git.git/blame - t/t2009-checkout-statinfo.sh
The third batch
[thirdparty/git.git] / t / t2009-checkout-statinfo.sh
CommitLineData
75336878
DB
1#!/bin/sh
2
3test_description='checkout should leave clean stat info'
4
883b98ef 5GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME=main
334afbc7
JS
6export GIT_TEST_DEFAULT_INITIAL_BRANCH_NAME
7
9081a421 8TEST_PASSES_SANITIZE_LEAK=true
75336878
DB
9. ./test-lib.sh
10
11test_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
23test_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
39test_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
55test_done
56