mirror of
https://github.com/git/git.git
synced 2024-10-28 21:07:52 +01:00
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>
This commit is contained in:
parent
7c08a2a637
commit
27bfd950c1
2 changed files with 39 additions and 1 deletions
|
@ -50,7 +50,7 @@ test_expect_success 'git diff-files --raw' '
|
||||||
test_cmp expect actual.files
|
test_cmp expect actual.files
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'git diff (empty submodule dir)' '
|
test_expect_failure 'git diff (empty submodule dir)' '
|
||||||
: >empty &&
|
: >empty &&
|
||||||
rm -rf sub/* sub/.git &&
|
rm -rf sub/* sub/.git &&
|
||||||
git diff > actual.empty &&
|
git diff > actual.empty &&
|
||||||
|
|
38
t/t7506-status-submodule.sh
Executable file
38
t/t7506-status-submodule.sh
Executable file
|
@ -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
|
Loading…
Reference in a new issue