diff options
Diffstat (limited to 't')
-rwxr-xr-x | t/t7508-status.sh | 103 |
1 files changed, 36 insertions, 67 deletions
diff --git a/t/t7508-status.sh b/t/t7508-status.sh index 8ed5788808..6b16bcb640 100755 --- a/t/t7508-status.sh +++ b/t/t7508-status.sh @@ -66,6 +66,12 @@ strip_comments () { rm "$1" && mv "$1".tmp "$1" } +cat >.gitignore <<\EOF +.gitignore +expect* +output* +EOF + test_expect_success 'status --column' ' cat >expect <<\EOF && # On branch master @@ -83,8 +89,8 @@ test_expect_success 'status --column' ' # Untracked files: # (use "git add <file>..." to include in what will be committed) # -# dir1/untracked dir2/untracked output -# dir2/modified expect untracked +# dir1/untracked dir2/untracked +# dir2/modified untracked # EOF COLUMNS=50 git -c status.displayCommentPrefix=true status --column="column dense" >output && @@ -116,8 +122,6 @@ cat >expect <<\EOF # dir1/untracked # dir2/modified # dir2/untracked -# expect -# output # untracked # EOF @@ -133,6 +137,23 @@ test_expect_success 'status with status.displayCommentPrefix=false' ' test_i18ncmp expect output ' +test_expect_success 'status -v' ' + (cat expect && git diff --cached) >expect-with-v && + git status -v >output && + test_i18ncmp expect-with-v output +' + +test_expect_success 'status -v -v' ' + (cat expect && + echo "Changes to be committed:" && + git -c diff.mnemonicprefix=true diff --cached && + echo "--------------------------------------------------" && + echo "Changes not staged for commit:" && + git -c diff.mnemonicprefix=true diff) >expect-with-v && + git status -v -v >output && + test_i18ncmp expect-with-v output +' + test_expect_success 'setup fake editor' ' cat >.git/editor <<-\EOF && #! /bin/sh @@ -167,8 +188,6 @@ Untracked files: dir1/untracked dir2/modified dir2/untracked - expect - output untracked EOF @@ -186,8 +205,6 @@ A dir2/added ?? dir1/untracked ?? dir2/modified ?? dir2/untracked -?? expect -?? output ?? untracked EOF @@ -201,7 +218,7 @@ test_expect_success 'status -s' ' test_expect_success 'status with gitignore' ' { echo ".gitignore" && - echo "expect" && + echo "expect*" && echo "output" && echo "untracked" } >.gitignore && @@ -222,6 +239,7 @@ test_expect_success 'status with gitignore' ' !! dir1/untracked !! dir2/untracked !! expect + !! expect-with-v !! output !! untracked EOF @@ -253,6 +271,7 @@ Ignored files: dir1/untracked dir2/untracked expect + expect-with-v output untracked @@ -264,7 +283,7 @@ EOF test_expect_success 'status with gitignore (nothing untracked)' ' { echo ".gitignore" && - echo "expect" && + echo "expect*" && echo "dir2/modified" && echo "output" && echo "untracked" @@ -285,6 +304,7 @@ test_expect_success 'status with gitignore (nothing untracked)' ' !! dir2/modified !! dir2/untracked !! expect + !! expect-with-v !! output !! untracked EOF @@ -312,6 +332,7 @@ Ignored files: dir2/modified dir2/untracked expect + expect-with-v output untracked @@ -320,7 +341,11 @@ EOF test_i18ncmp expect output ' -rm -f .gitignore +cat >.gitignore <<\EOF +.gitignore +expect* +output* +EOF cat >expect <<\EOF ## master @@ -329,8 +354,6 @@ A dir2/added ?? dir1/untracked ?? dir2/modified ?? dir2/untracked -?? expect -?? output ?? untracked EOF @@ -434,8 +457,6 @@ Untracked files: dir2/modified dir2/untracked dir3/ - expect - output untracked EOF @@ -456,8 +477,6 @@ A dir2/added ?? dir2/modified ?? dir2/untracked ?? dir3/ -?? expect -?? output ?? untracked EOF test_expect_success 'status -s -unormal' ' @@ -493,8 +512,6 @@ Untracked files: dir2/untracked dir3/untracked1 dir3/untracked2 - expect - output untracked EOF @@ -518,8 +535,6 @@ A dir2/added ?? dir1/untracked ?? dir2/modified ?? dir2/untracked -?? expect -?? output ?? untracked EOF test_expect_success 'status -s -uall' ' @@ -554,8 +569,6 @@ Untracked files: untracked ../dir2/modified ../dir2/untracked - ../expect - ../output ../untracked EOF @@ -569,8 +582,6 @@ A ../dir2/added ?? untracked ?? ../dir2/modified ?? ../dir2/untracked -?? ../expect -?? ../output ?? ../untracked EOF test_expect_success 'status -s with relative paths' ' @@ -586,8 +597,6 @@ A dir2/added ?? dir1/untracked ?? dir2/modified ?? dir2/untracked -?? expect -?? output ?? untracked EOF @@ -625,8 +634,6 @@ Untracked files: <BLUE>dir1/untracked<RESET> <BLUE>dir2/modified<RESET> <BLUE>dir2/untracked<RESET> - <BLUE>expect<RESET> - <BLUE>output<RESET> <BLUE>untracked<RESET> EOF @@ -647,8 +654,6 @@ cat >expect <<\EOF <BLUE>??<RESET> dir1/untracked <BLUE>??<RESET> dir2/modified <BLUE>??<RESET> dir2/untracked -<BLUE>??<RESET> expect -<BLUE>??<RESET> output <BLUE>??<RESET> untracked EOF @@ -676,8 +681,6 @@ cat >expect <<\EOF <BLUE>??<RESET> dir1/untracked <BLUE>??<RESET> dir2/modified <BLUE>??<RESET> dir2/untracked -<BLUE>??<RESET> expect -<BLUE>??<RESET> output <BLUE>??<RESET> untracked EOF @@ -694,8 +697,6 @@ A dir2/added ?? dir1/untracked ?? dir2/modified ?? dir2/untracked -?? expect -?? output ?? untracked EOF @@ -755,8 +756,6 @@ Untracked files: dir1/untracked dir2/modified dir2/untracked - expect - output untracked EOF @@ -772,8 +771,6 @@ A dir2/added ?? dir1/untracked ?? dir2/modified ?? dir2/untracked -?? expect -?? output ?? untracked EOF @@ -798,8 +795,6 @@ Untracked files: dir1/untracked dir2/ - expect - output untracked EOF @@ -848,8 +843,6 @@ Untracked files: dir1/untracked dir2/modified dir2/untracked - expect - output untracked EOF @@ -870,8 +863,6 @@ A sm ?? dir1/untracked ?? dir2/modified ?? dir2/untracked -?? expect -?? output ?? untracked EOF test_expect_success 'status -s submodule summary is disabled by default' ' @@ -913,8 +904,6 @@ Untracked files: dir1/untracked dir2/modified dir2/untracked - expect - output untracked EOF @@ -940,8 +929,6 @@ A sm ?? dir1/untracked ?? dir2/modified ?? dir2/untracked -?? expect -?? output ?? untracked EOF test_expect_success 'status -s submodule summary' ' @@ -964,8 +951,6 @@ Untracked files: dir1/untracked dir2/modified dir2/untracked - expect - output untracked no changes added to commit (use "git add" and/or "git commit -a") @@ -983,8 +968,6 @@ cat >expect <<EOF ?? dir1/untracked ?? dir2/modified ?? dir2/untracked -?? expect -?? output ?? untracked EOF test_expect_success 'status -s submodule summary (clean submodule)' ' @@ -1025,8 +1008,6 @@ Untracked files: dir1/untracked dir2/modified dir2/untracked - expect - output untracked EOF @@ -1080,8 +1061,6 @@ Untracked files: dir1/untracked dir2/modified dir2/untracked - expect - output untracked EOF @@ -1192,8 +1171,6 @@ Untracked files: dir1/untracked dir2/modified dir2/untracked - expect - output untracked EOF @@ -1254,8 +1231,6 @@ Untracked files: dir1/untracked dir2/modified dir2/untracked - expect - output untracked EOF @@ -1336,8 +1311,6 @@ cat > expect << EOF ; dir1/untracked ; dir2/modified ; dir2/untracked -; expect -; output ; untracked ; EOF @@ -1369,8 +1342,6 @@ Untracked files: dir1/untracked dir2/modified dir2/untracked - expect - output untracked no changes added to commit (use "git add" and/or "git commit -a") @@ -1400,8 +1371,6 @@ Untracked files: dir1/untracked dir2/modified dir2/untracked - expect - output untracked EOF |