Code

Merge branch 'maint'
[git.git] / t / t7502-status.sh
index 0d24e259fb69f9e0be51a9f997bb92176b55600d..c8e4c2e7b452c5e8db3958a85195c8cc5f6918f5 100755 (executable)
@@ -3,7 +3,7 @@
 # Copyright (c) 2007 Johannes E. Schindelin
 #
 
-test_description='git-status'
+test_description='git status'
 
 . ./test-lib.sh
 
@@ -67,6 +67,34 @@ test_expect_success 'status (2)' '
 
 '
 
+cat >expect <<EOF
+# On branch master
+# Changes to be committed:
+#   (use "git reset HEAD <file>..." to unstage)
+#
+#      new file:   dir2/added
+#
+# Changed but not updated:
+#   (use "git add <file>..." to update what will be committed)
+#
+#      modified:   dir1/modified
+#
+# Untracked files not listed (use -u option to show untracked files)
+EOF
+test_expect_success 'status -uno' '
+       mkdir dir3 &&
+       : > dir3/untracked1 &&
+       : > dir3/untracked2 &&
+       git status -uno >output &&
+       test_cmp expect output
+'
+
+test_expect_success 'status (status.showUntrackedFiles no)' '
+       git config status.showuntrackedfiles no
+       git status >output &&
+       test_cmp expect output
+'
+
 cat >expect <<EOF
 # On branch master
 # Changes to be committed:
@@ -91,13 +119,16 @@ cat >expect <<EOF
 #      untracked
 EOF
 test_expect_success 'status -unormal' '
-       mkdir dir3 &&
-       : > dir3/untracked1 &&
-       : > dir3/untracked2 &&
        git status -unormal >output &&
        test_cmp expect output
 '
 
+test_expect_success 'status (status.showUntrackedFiles normal)' '
+       git config status.showuntrackedfiles normal
+       git status >output &&
+       test_cmp expect output
+'
+
 cat >expect <<EOF
 # On branch master
 # Changes to be committed:
@@ -124,7 +155,13 @@ cat >expect <<EOF
 EOF
 test_expect_success 'status -uall' '
        git status -uall >output &&
+       test_cmp expect output
+'
+test_expect_success 'status (status.showUntrackedFiles all)' '
+       git config status.showuntrackedfiles all
+       git status >output &&
        rm -rf dir3 &&
+       git config --unset status.showuntrackedfiles &&
        test_cmp expect output
 '