diff options
author | Brian Gernhardt <brian@silverinsanity.com> | 2010-06-25 13:20:48 -0400 |
---|---|---|
committer | Junio C Hamano <gitster@pobox.com> | 2010-06-25 10:54:04 -0700 |
commit | 6ed7ddaadba9217b794aecf6d74a2e455daf7a96 (patch) | |
tree | a737d30a55681c332073eaef856c8c34949c3566 /t/t4041-diff-submodule-option.sh | |
parent | dd44d419d30afa52b863efa07aeec738c4531ea9 (diff) | |
download | git-6ed7ddaadba9217b794aecf6d74a2e455daf7a96.tar.gz |
t4027,4041: Use test -s to test for an empty file
The tests used a mixture of 'echo -n' (which is non-portable) and either
test_cmp or diff to check if a file is empty. The much easier and portable
method to check for an empty file is '! test -s'
While we're in t4027, there was an excess test_done. Remove it.
Signed-off-by: Brian Gernhardt <brian@gernhardtsoftware.com>
Signed-off-by: Junio C Hamano <gitster@pobox.com>
Diffstat (limited to 't/t4041-diff-submodule-option.sh')
-rwxr-xr-x | t/t4041-diff-submodule-option.sh | 14 |
1 files changed, 7 insertions, 7 deletions
diff --git a/t/t4041-diff-submodule-option.sh b/t/t4041-diff-submodule-option.sh index f44b9064ea..8e391cf9a7 100755 --- a/t/t4041-diff-submodule-option.sh +++ b/t/t4041-diff-submodule-option.sh @@ -207,17 +207,17 @@ EOF test_expect_success 'submodule contains untracked content (untracked ignored)' " git diff-index -p --ignore-submodules=untracked --submodule=log HEAD >actual && - echo -n '' | diff actual - + ! test -s actual " test_expect_success 'submodule contains untracked content (dirty ignored)' " git diff-index -p --ignore-submodules=dirty --submodule=log HEAD >actual && - echo -n '' | diff actual - + ! test -s actual " test_expect_success 'submodule contains untracked content (all ignored)' " git diff-index -p --ignore-submodules=all --submodule=log HEAD >actual && - echo -n '' | diff actual - + ! test -s actual " test_expect_success 'submodule contains untracked and modifed content' " @@ -240,13 +240,13 @@ EOF test_expect_success 'submodule contains untracked and modifed content (dirty ignored)' " echo new > sm1/foo6 && git diff-index -p --ignore-submodules=dirty --submodule=log HEAD >actual && - echo -n '' | diff actual - + ! test -s actual " test_expect_success 'submodule contains untracked and modifed content (all ignored)' " echo new > sm1/foo6 && git diff-index -p --ignore-submodules --submodule=log HEAD >actual && - echo -n '' | diff actual - + ! test -s actual " test_expect_success 'submodule contains modifed content' " @@ -295,7 +295,7 @@ EOF test_expect_success 'modified submodule contains untracked content (all ignored)' " git diff-index -p --ignore-submodules=all --submodule=log HEAD >actual && - echo -n '' | diff actual - + ! test -s actual " test_expect_success 'modified submodule contains untracked and modifed content' " @@ -331,7 +331,7 @@ EOF test_expect_success 'modified submodule contains untracked and modifed content (all ignored)' " echo modification >> sm1/foo6 && git diff-index -p --ignore-submodules --submodule=log HEAD >actual && - echo -n '' | diff actual - + ! test -s actual " test_expect_success 'modified submodule contains modifed content' " |