summaryrefslogtreecommitdiff
path: root/t/t7506-status-submodule.sh
diff options
context:
space:
mode:
authorPing Yin <pkufranky@gmail.com>2008-05-02 21:35:34 +0800
committerJunio C Hamano <gitster@pobox.com>2008-05-04 17:41:27 -0700
commit27bfd950c19c76dce28a8c8693f4ed8603875d26 (patch)
tree6a9dbadb232a4aa438219d709bf82f0b0da657f7 /t/t7506-status-submodule.sh
parent7c08a2a6370ea70f16addcbad9096b4510a6b467 (diff)
downloadgit-27bfd950c19c76dce28a8c8693f4ed8603875d26.tar.gz
Add t7506 to test submodule related functions for git-status
Signed-off-by: Ping Yin <pkufranky@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t7506-status-submodule.sh')
-rwxr-xr-xt/t7506-status-submodule.sh38
1 files changed, 38 insertions, 0 deletions
diff --git a/t/t7506-status-submodule.sh b/t/t7506-status-submodule.sh
new file mode 100755
index 0000000000..8987c9eb70
--- /dev/null
+++ b/t/t7506-status-submodule.sh
@@ -0,0 +1,38 @@
+#!/bin/sh
+
+test_description='git-status for submodule'
+
+. ./test-lib.sh
+
+test_expect_success 'setup' '
+ test_create_repo sub
+ cd sub &&
+ : >bar &&
+ git add bar &&
+ git commit -m " Add bar" &&
+ cd .. &&
+ git add sub &&
+ git commit -m "Add submodule sub"
+'
+
+test_expect_success 'status clean' '
+ git status |
+ grep "nothing to commit"
+'
+test_expect_success 'status -a clean' '
+ git status -a |
+ grep "nothing to commit"
+'
+test_expect_success 'rm submodule contents' '
+ rm -rf sub/* sub/.git
+'
+test_expect_success 'status clean (empty submodule dir)' '
+ git status |
+ grep "nothing to commit"
+'
+test_expect_failure 'status -a clean (empty submodule dir)' '
+ git status -a |
+ grep "nothing to commit"
+'
+
+test_done