X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft7502-status.sh;h=93f875f50054225e0879843b6e29ac057ba6c020;hb=0eb5ebc1d862737ea2b313d0d77d120b3d114099;hp=80a438d4d988baa54a25e5725665904c6c45f431;hpb=c636d0e2bcffdbd55c096944561d9ac470da600e;p=git.git diff --git a/t/t7502-status.sh b/t/t7502-status.sh index 80a438d4d..93f875f50 100755 --- a/t/t7502-status.sh +++ b/t/t7502-status.sh @@ -3,7 +3,7 @@ # Copyright (c) 2007 Johannes E. Schindelin # -test_description='git-status' +test_description='git status' . ./test-lib.sh @@ -46,6 +46,7 @@ cat > expect << \EOF # # Changed but not updated: # (use "git add ..." to update what will be committed) +# (use "git checkout -- ..." to discard changes in working directory) # # modified: dir1/modified # @@ -67,6 +68,107 @@ test_expect_success 'status (2)' ' ' +cat >expect <..." to unstage) +# +# new file: dir2/added +# +# Changed but not updated: +# (use "git add ..." to update what will be committed) +# (use "git checkout -- ..." to discard changes in working directory) +# +# 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 <..." to unstage) +# +# new file: dir2/added +# +# Changed but not updated: +# (use "git add ..." to update what will be committed) +# (use "git checkout -- ..." to discard changes in working directory) +# +# modified: dir1/modified +# +# Untracked files: +# (use "git add ..." to include in what will be committed) +# +# dir1/untracked +# dir2/modified +# dir2/untracked +# dir3/ +# expect +# output +# untracked +EOF +test_expect_success 'status -unormal' ' + 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 <..." to unstage) +# +# new file: dir2/added +# +# Changed but not updated: +# (use "git add ..." to update what will be committed) +# (use "git checkout -- ..." to discard changes in working directory) +# +# modified: dir1/modified +# +# Untracked files: +# (use "git add ..." to include in what will be committed) +# +# dir1/untracked +# dir2/modified +# dir2/untracked +# dir3/untracked1 +# dir3/untracked2 +# expect +# output +# untracked +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 +' + cat > expect << \EOF # On branch master # Changes to be committed: @@ -76,6 +178,7 @@ cat > expect << \EOF # # Changed but not updated: # (use "git add ..." to update what will be committed) +# (use "git checkout -- ..." to discard changes in working directory) # # modified: modified # @@ -106,6 +209,7 @@ cat > expect << \EOF # # Changed but not updated: # (use "git add ..." to update what will be committed) +# (use "git checkout -- ..." to discard changes in working directory) # # modified: dir1/modified # @@ -169,6 +273,7 @@ cat >expect <..." to update what will be committed) +# (use "git checkout -- ..." to discard changes in working directory) # # modified: dir1/modified # @@ -187,6 +292,12 @@ test_expect_success 'status submodule summary is disabled by default' ' test_cmp expect output ' +# we expect the same as the previous test +test_expect_success 'status --untracked-files=all does not show submodule' ' + git status --untracked-files=all >output && + test_cmp expect output +' + head=$(cd sm && git rev-parse --short=7 --verify HEAD) cat >expect <expect <..." to update what will be committed) +# (use "git checkout -- ..." to discard changes in working directory) # # modified: dir1/modified # @@ -228,6 +340,7 @@ cat >expect <..." to update what will be committed) +# (use "git checkout -- ..." to discard changes in working directory) # # modified: dir1/modified # @@ -259,6 +372,7 @@ cat >expect <..." to update what will be committed) +# (use "git checkout -- ..." to discard changes in working directory) # # modified: dir1/modified #