aboutsummaryrefslogtreecommitdiff
path: root/t/t7401-submodule-summary.sh
diff options
context:
space:
mode:
authorJens Lehmann <Jens.Lehmann@web.de>2009-08-13 21:32:50 +0200
committerJunio C Hamano <gitster@pobox.com>2009-08-14 19:50:11 -0700
commit1c244f6ee5775b227177a66cdcf49a410d9d6871 (patch)
treebe041c91485f8f3f3bdf0a2acfb55ebfc5887b13 /t/t7401-submodule-summary.sh
parent6ffd781226f04629eff63a684b47ad7555143312 (diff)
downloadgit-1c244f6ee5775b227177a66cdcf49a410d9d6871.tar.gz
git-1c244f6ee5775b227177a66cdcf49a410d9d6871.tar.xz
git submodule summary: add --files option
git submodule summary is providing similar functionality for submodules as git diff-index does for a git project (including the meaning of --cached). But the analogon to git diff-files is missing, so add a --files option to summarize the differences between the index of the super project and the last commit checked out in the working tree of the submodule. Signed-off-by: Jens Lehmann <Jens.Lehmann@web.de> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7401-submodule-summary.sh')
-rwxr-xr-xt/t7401-submodule-summary.sh22
1 files changed, 22 insertions, 0 deletions
diff --git a/t/t7401-submodule-summary.sh b/t/t7401-submodule-summary.sh
index 61498293b..6cc16c39f 100755
--- a/t/t7401-submodule-summary.sh
+++ b/t/t7401-submodule-summary.sh
@@ -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)' "
@@ -205,4 +223,8 @@ test_expect_success '--for-status' "
EOF
"
+test_expect_success 'fail when using --files together with --cached' "
+ test_must_fail git submodule summary --files --cached
+"
+
test_done