X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;f=t%2Ft7502-status.sh;h=e4bfcaece0c3ac4ea4b33521e84bd7fc1c19422e;hb=6d2c1c2dc064c40f6c723e0a25b5f813732fdaff;hp=e00607490bcb0439c6557003a3419d84823a8f00;hpb=860cc3a4f9c3ac21fcd37bbe30f40ab073f01299;p=git.git diff --git a/t/t7502-status.sh b/t/t7502-status.sh index e00607490..e4bfcaece 100755 --- a/t/t7502-status.sh +++ b/t/t7502-status.sh @@ -33,7 +33,7 @@ test_expect_success 'setup' ' test_expect_success 'status (1)' ' - grep -e "use \"git rm --cached \.\.\.\" to unstage" output + grep "use \"git rm --cached \.\.\.\" to unstage" output ' @@ -146,7 +146,141 @@ cat <expect EOF test_expect_success 'status of partial commit excluding new file in index' ' git status dir1/modified >output && - diff -u expect output + test_cmp expect output +' + +test_expect_success 'setup status submodule summary' ' + test_create_repo sm && ( + cd sm && + >foo && + git add foo && + git commit -m "Add foo" + ) && + git add sm +' + +cat >expect <..." to unstage) +# +# new file: dir2/added +# new file: sm +# +# Changed but not updated: +# (use "git add ..." to update what will be committed) +# +# modified: dir1/modified +# +# Untracked files: +# (use "git add ..." to include in what will be committed) +# +# dir1/untracked +# dir2/modified +# dir2/untracked +# expect +# output +# untracked +EOF +test_expect_success 'status submodule summary is disabled by default' ' + git status >output && + test_cmp expect output +' + +head=$(cd sm && git rev-parse --short=7 --verify HEAD) + +cat >expect <..." to unstage) +# +# new file: dir2/added +# new file: sm +# +# Changed but not updated: +# (use "git add ..." to update what will be committed) +# +# modified: dir1/modified +# +# Modified submodules: +# +# * sm 0000000...$head (1): +# > Add foo +# +# Untracked files: +# (use "git add ..." to include in what will be committed) +# +# dir1/untracked +# dir2/modified +# dir2/untracked +# expect +# output +# untracked +EOF +test_expect_success 'status submodule summary' ' + git config status.submodulesummary 10 && + git status >output && + test_cmp expect output +' + + +cat >expect <..." to update what will be committed) +# +# modified: dir1/modified +# +# Untracked files: +# (use "git add ..." to include in what will be committed) +# +# dir1/untracked +# dir2/modified +# dir2/untracked +# expect +# output +# untracked +no changes added to commit (use "git add" and/or "git commit -a") +EOF +test_expect_success 'status submodule summary (clean submodule)' ' + git commit -m "commit submodule" && + git config status.submodulesummary 10 && + test_must_fail git status >output && + test_cmp expect output +' + +cat >expect <..." to unstage) +# +# new file: dir2/added +# new file: sm +# +# Changed but not updated: +# (use "git add ..." to update what will be committed) +# +# modified: dir1/modified +# +# Modified submodules: +# +# * sm 0000000...$head (1): +# > Add foo +# +# Untracked files: +# (use "git add ..." to include in what will be committed) +# +# dir1/untracked +# dir2/modified +# dir2/untracked +# expect +# output +# untracked +EOF +test_expect_success 'status submodule summary (--amend)' ' + git config status.submodulesummary 10 && + git status --amend >output && + test_cmp expect output ' test_done