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>
Ping Yin committed
May 2, 2008 at 21:35 UTC
27bfd950c19c76dce28a8c8693f4ed8603875d26
2 files changed
+39
-1
t/t4027-diff-submodule.sh
+1
-1
@@ -50,7 +50,7 @@ test_expect_success 'git diff-files --raw' '
50
test_cmp expect actual.files
51
'
52
53
-test_expect_success 'git diff (empty submodule dir)' '
53
+test_expect_failure 'git diff (empty submodule dir)' '
54
: >empty &&
55
rm -rf sub/* sub/.git &&
56
git diff > actual.empty &&
t/t7506-status-submodule.sh
new
+38
@@ -0,0 +1,38 @@
1
+#!/bin/sh
2
+
3
+test_description='git-status for submodule'
4
+
5
+. ./test-lib.sh
6
+
7
+test_expect_success 'setup' '
8
+ test_create_repo sub
9
+ cd sub &&
10
+ : >bar &&
11
+ git add bar &&
12
+ git commit -m " Add bar" &&
13
+ cd .. &&
14
+ git add sub &&
15
+ git commit -m "Add submodule sub"
16
+'
17
+
18
+test_expect_success 'status clean' '
19
+ git status |
20
+ grep "nothing to commit"
21
+'
22
+test_expect_success 'status -a clean' '
23
+ git status -a |
24
+ grep "nothing to commit"
25
+'
26
+test_expect_success 'rm submodule contents' '
27
+ rm -rf sub/* sub/.git
28
+'
29
+test_expect_success 'status clean (empty submodule dir)' '
30
+ git status |
31
+ grep "nothing to commit"
32
+'
33
+test_expect_failure 'status -a clean (empty submodule dir)' '
34
+ git status -a |
35
+ grep "nothing to commit"
36
+'
37
+
38
+test_done