X-Git-Url: https://git.tokkee.org/?a=blobdiff_plain;ds=sidebyside;f=t%2Ft7401-submodule-summary.sh;h=6cc16c39fe75ee9dab942fc5ae376827d3b7ea44;hb=6ea71fe7d36cf5b81c2100d97a822ecf0bc04746;hp=0f3c42ab35891d1dd671649ff38074a1d83e2a5b;hpb=77ad7a49d3cc946487ca759e5361effbcfb03be5;p=git.git diff --git a/t/t7401-submodule-summary.sh b/t/t7401-submodule-summary.sh index 0f3c42ab3..6cc16c39f 100755 --- a/t/t7401-submodule-summary.sh +++ b/t/t7401-submodule-summary.sh @@ -5,7 +5,7 @@ test_description='Summary support for submodules -This test tries to verify the sanity of summary subcommand of git-submodule. +This test tries to verify the sanity of summary subcommand of git submodule. ' . ./test-lib.sh @@ -30,7 +30,7 @@ commit_file () { } test_create_repo sm1 && -add_file . foo +add_file . foo >/dev/null head1=$(add_file sm1 foo1 foo2) @@ -56,6 +56,15 @@ test_expect_success 'modified submodule(forward)' " EOF " +test_expect_success 'modified submodule(forward), --files' " + git submodule summary --files >actual && + diff actual - <<-EOF +* sm1 $head1...$head2 (1): + > Add foo3 + +EOF +" + commit_file sm1 && cd sm1 && git reset --hard HEAD~2 >/dev/null && @@ -114,6 +123,15 @@ test_expect_success 'typechanged submodule(submodule->blob), --cached' " EOF " +test_expect_success 'typechanged submodule(submodule->blob), --files' " + git submodule summary --files >actual && + diff actual - <<-EOF +* sm1 $head5(blob)->$head4(submodule) (3): + > Add foo5 + +EOF +" + rm -rf sm1 && git checkout-index sm1 test_expect_success 'typechanged submodule(submodule->blob)' " @@ -192,4 +210,21 @@ test_expect_success 'given commit' " EOF " +test_expect_success '--for-status' " + git submodule summary --for-status HEAD^ >actual && + test_cmp actual - < Add foo9 +# +EOF +" + +test_expect_success 'fail when using --files together with --cached' " + test_must_fail git submodule summary --files --cached +" + test_done