3 # Copyright (c) 2007 Johannes E. Schindelin
6 test_description
='git-status'
10 test_expect_success
'setup' '
24 git commit -m initial &&
28 echo 1 > dir1/modified &&
29 echo 2 > dir2/modified &&
30 echo 3 > dir2/added &&
34 test_expect_success
'status (1)' '
36 grep -e "use \"git rm --cached <file>\.\.\.\" to unstage" output
42 # Changes to be committed:
43 # (use "git reset HEAD <file>..." to unstage)
45 # new file: dir2/added
47 # Changed but not updated:
48 # (use "git add <file>..." to update what will be committed)
50 # modified: dir1/modified
53 # (use "git add <file>..." to include in what will be committed)
63 test_expect_success
'status (2)' '
65 git status > output &&
66 git diff expect output
72 # Changes to be committed:
73 # (use "git reset HEAD <file>..." to unstage)
75 # new file: ../dir2/added
77 # Changed but not updated:
78 # (use "git add <file>..." to update what will be committed)
83 # (use "git add <file>..." to include in what will be committed)
93 test_expect_success
'status with relative paths' '
95 (cd dir1 && git status) > output &&
96 git diff expect output
102 # Changes to be committed:
103 # (use "git reset HEAD <file>..." to unstage)
105 # new file: dir2/added
107 # Changed but not updated:
108 # (use "git add <file>..." to update what will be committed)
110 # modified: dir1/modified
113 # (use "git add <file>..." to include in what will be committed)
123 test_expect_success
'status without relative paths' '
125 git config status.relativePaths false
126 (cd dir1 && git status) > output &&
127 git diff expect output
133 # Changes to be committed:
134 # (use "git reset HEAD <file>..." to unstage)
136 # modified: dir1/modified
139 # (use "git add <file>..." to include in what will be committed)
147 test_expect_success
'status of partial commit excluding new file in index' '
148 git status dir1/modified >output &&
149 diff -u expect output