aboutsummaryrefslogtreecommitdiff
path: root/t/t7506-status-submodule.sh
blob: 3ca17abad1847704f222f1cfe744463debfc96ff (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
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 'commit --dry-run -a clean' '
	git commit --dry-run -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_success 'status -a clean (empty submodule dir)' '
	git commit --dry-run -a |
	grep "nothing to commit"
'

test_done