: > dir1/tracked &&
: > dir1/modified &&
git add . &&
+
+ git status >output &&
+
test_tick &&
git commit -m initial &&
: > untracked &&
git add dir2/added
'
+test_expect_success 'status (1)' '
+
+ grep "use \"git rm --cached <file>\.\.\.\" to unstage" output
+
+'
+
cat > expect << \EOF
# On branch master
# Changes to be committed:
# untracked
EOF
-test_expect_success 'status' '
+test_expect_success 'status (2)' '
git status > output &&
git diff expect output
'
+cat <<EOF >expect
+# On branch master
+# Changes to be committed:
+# (use "git reset HEAD <file>..." to unstage)
+#
+# modified: dir1/modified
+#
+# Untracked files:
+# (use "git add <file>..." to include in what will be committed)
+#
+# dir1/untracked
+# dir2/
+# expect
+# output
+# untracked
+EOF
+test_expect_success 'status of partial commit excluding new file in index' '
+ git status dir1/modified >output &&
+ test_cmp expect output
+'
+
test_done