]> git.ipfire.org Git - thirdparty/git.git/blame - t/t2009-checkout-statinfo.sh
Merge branch 'pb/ci-matrix-wo-shortcut'
[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
75336878
DB
8. ./test-lib.sh
9
10test_expect_success 'setup' '
11
12 echo hello >world &&
13 git update-index --add world &&
14 git commit -m initial &&
15 git branch side &&
16 echo goodbye >world &&
17 git update-index --add world &&
18 git commit -m second
19
20'
21
22test_expect_success 'branch switching' '
23
24 git reset --hard &&
25 test "$(git diff-files --raw)" = "" &&
26
883b98ef 27 git checkout main &&
75336878
DB
28 test "$(git diff-files --raw)" = "" &&
29
30 git checkout side &&
31 test "$(git diff-files --raw)" = "" &&
32
883b98ef 33 git checkout main &&
75336878
DB
34 test "$(git diff-files --raw)" = ""
35
36'
37
38test_expect_success 'path checkout' '
39
40 git reset --hard &&
41 test "$(git diff-files --raw)" = "" &&
42
883b98ef 43 git checkout main world &&
75336878
DB
44 test "$(git diff-files --raw)" = "" &&
45
46 git checkout side world &&
47 test "$(git diff-files --raw)" = "" &&
48
883b98ef 49 git checkout main world &&
75336878
DB
50 test "$(git diff-files --raw)" = ""
51
52'
53
54test_done
55