Merge branch 'sl/test-wc-l-line-count' into maint
By Stefano Lattarini * sl/test-wc-l-line-count: tests: modernise style: more uses of test_line_count
This commit is contained in:
commit
538847cd4c
@ -100,8 +100,7 @@ test_expect_success setup '
|
|||||||
|
|
||||||
check_fsck &&
|
check_fsck &&
|
||||||
|
|
||||||
loglen=$(wc -l <.git/logs/refs/heads/master) &&
|
test_line_count = 4 .git/logs/refs/heads/master
|
||||||
test $loglen = 4
|
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success rewind '
|
test_expect_success rewind '
|
||||||
@ -117,8 +116,7 @@ test_expect_success rewind '
|
|||||||
|
|
||||||
check_have A B C D E F G H I J K L &&
|
check_have A B C D E F G H I J K L &&
|
||||||
|
|
||||||
loglen=$(wc -l <.git/logs/refs/heads/master) &&
|
test_line_count = 5 .git/logs/refs/heads/master
|
||||||
test $loglen = 5
|
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'corrupt and check' '
|
test_expect_success 'corrupt and check' '
|
||||||
@ -136,8 +134,7 @@ test_expect_success 'reflog expire --dry-run should not touch reflog' '
|
|||||||
--stale-fix \
|
--stale-fix \
|
||||||
--all &&
|
--all &&
|
||||||
|
|
||||||
loglen=$(wc -l <.git/logs/refs/heads/master) &&
|
test_line_count = 5 .git/logs/refs/heads/master &&
|
||||||
test $loglen = 5 &&
|
|
||||||
|
|
||||||
check_fsck "missing blob $F"
|
check_fsck "missing blob $F"
|
||||||
'
|
'
|
||||||
@ -150,8 +147,7 @@ test_expect_success 'reflog expire' '
|
|||||||
--stale-fix \
|
--stale-fix \
|
||||||
--all &&
|
--all &&
|
||||||
|
|
||||||
loglen=$(wc -l <.git/logs/refs/heads/master) &&
|
test_line_count = 2 .git/logs/refs/heads/master &&
|
||||||
test $loglen = 2 &&
|
|
||||||
|
|
||||||
check_fsck "dangling commit $K"
|
check_fsck "dangling commit $K"
|
||||||
'
|
'
|
||||||
@ -217,9 +213,7 @@ test_expect_success 'delete' '
|
|||||||
test_expect_success 'rewind2' '
|
test_expect_success 'rewind2' '
|
||||||
|
|
||||||
test_tick && git reset --hard HEAD~2 &&
|
test_tick && git reset --hard HEAD~2 &&
|
||||||
loglen=$(wc -l <.git/logs/refs/heads/master) &&
|
test_line_count = 4 .git/logs/refs/heads/master
|
||||||
test $loglen = 4
|
|
||||||
|
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success '--expire=never' '
|
test_expect_success '--expire=never' '
|
||||||
@ -228,9 +222,7 @@ test_expect_success '--expire=never' '
|
|||||||
--expire=never \
|
--expire=never \
|
||||||
--expire-unreachable=never \
|
--expire-unreachable=never \
|
||||||
--all &&
|
--all &&
|
||||||
loglen=$(wc -l <.git/logs/refs/heads/master) &&
|
test_line_count = 4 .git/logs/refs/heads/master
|
||||||
test $loglen = 4
|
|
||||||
|
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'gc.reflogexpire=never' '
|
test_expect_success 'gc.reflogexpire=never' '
|
||||||
@ -238,8 +230,7 @@ test_expect_success 'gc.reflogexpire=never' '
|
|||||||
git config gc.reflogexpire never &&
|
git config gc.reflogexpire never &&
|
||||||
git config gc.reflogexpireunreachable never &&
|
git config gc.reflogexpireunreachable never &&
|
||||||
git reflog expire --verbose --all &&
|
git reflog expire --verbose --all &&
|
||||||
loglen=$(wc -l <.git/logs/refs/heads/master) &&
|
test_line_count = 4 .git/logs/refs/heads/master
|
||||||
test $loglen = 4
|
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'gc.reflogexpire=false' '
|
test_expect_success 'gc.reflogexpire=false' '
|
||||||
@ -247,8 +238,7 @@ test_expect_success 'gc.reflogexpire=false' '
|
|||||||
git config gc.reflogexpire false &&
|
git config gc.reflogexpire false &&
|
||||||
git config gc.reflogexpireunreachable false &&
|
git config gc.reflogexpireunreachable false &&
|
||||||
git reflog expire --verbose --all &&
|
git reflog expire --verbose --all &&
|
||||||
loglen=$(wc -l <.git/logs/refs/heads/master) &&
|
test_line_count = 4 .git/logs/refs/heads/master &&
|
||||||
test $loglen = 4 &&
|
|
||||||
|
|
||||||
git config --unset gc.reflogexpire &&
|
git config --unset gc.reflogexpire &&
|
||||||
git config --unset gc.reflogexpireunreachable
|
git config --unset gc.reflogexpireunreachable
|
||||||
|
@ -40,7 +40,7 @@ test_expect_success \
|
|||||||
rm -f path* .merge_* out .git/index &&
|
rm -f path* .merge_* out .git/index &&
|
||||||
git read-tree $t1 &&
|
git read-tree $t1 &&
|
||||||
git checkout-index --temp -- path1 >out &&
|
git checkout-index --temp -- path1 >out &&
|
||||||
test $(wc -l <out) = 1 &&
|
test_line_count = 1 out &&
|
||||||
test $(cut "-d " -f2 out) = path1 &&
|
test $(cut "-d " -f2 out) = path1 &&
|
||||||
p=$(cut "-d " -f1 out) &&
|
p=$(cut "-d " -f1 out) &&
|
||||||
test -f $p &&
|
test -f $p &&
|
||||||
@ -51,7 +51,7 @@ test_expect_success \
|
|||||||
rm -f path* .merge_* out .git/index &&
|
rm -f path* .merge_* out .git/index &&
|
||||||
git read-tree $t1 &&
|
git read-tree $t1 &&
|
||||||
git checkout-index -a --temp >out &&
|
git checkout-index -a --temp >out &&
|
||||||
test $(wc -l <out) = 5 &&
|
test_line_count = 5 out &&
|
||||||
for f in path0 path1 path3 path4 asubdir/path5
|
for f in path0 path1 path3 path4 asubdir/path5
|
||||||
do
|
do
|
||||||
test $(grep $f out | cut "-d " -f2) = $f &&
|
test $(grep $f out | cut "-d " -f2) = $f &&
|
||||||
@ -69,7 +69,7 @@ test_expect_success \
|
|||||||
'checkout one stage 2 to temporary file' '
|
'checkout one stage 2 to temporary file' '
|
||||||
rm -f path* .merge_* out &&
|
rm -f path* .merge_* out &&
|
||||||
git checkout-index --stage=2 --temp -- path1 >out &&
|
git checkout-index --stage=2 --temp -- path1 >out &&
|
||||||
test $(wc -l <out) = 1 &&
|
test_line_count = 1 out &&
|
||||||
test $(cut "-d " -f2 out) = path1 &&
|
test $(cut "-d " -f2 out) = path1 &&
|
||||||
p=$(cut "-d " -f1 out) &&
|
p=$(cut "-d " -f1 out) &&
|
||||||
test -f $p &&
|
test -f $p &&
|
||||||
@ -79,7 +79,7 @@ test_expect_success \
|
|||||||
'checkout all stage 2 to temporary files' '
|
'checkout all stage 2 to temporary files' '
|
||||||
rm -f path* .merge_* out &&
|
rm -f path* .merge_* out &&
|
||||||
git checkout-index --all --stage=2 --temp >out &&
|
git checkout-index --all --stage=2 --temp >out &&
|
||||||
test $(wc -l <out) = 3 &&
|
test_line_count = 3 out &&
|
||||||
for f in path1 path2 path4
|
for f in path1 path2 path4
|
||||||
do
|
do
|
||||||
test $(grep $f out | cut "-d " -f2) = $f &&
|
test $(grep $f out | cut "-d " -f2) = $f &&
|
||||||
@ -92,13 +92,13 @@ test_expect_success \
|
|||||||
'checkout all stages/one file to nothing' '
|
'checkout all stages/one file to nothing' '
|
||||||
rm -f path* .merge_* out &&
|
rm -f path* .merge_* out &&
|
||||||
git checkout-index --stage=all --temp -- path0 >out &&
|
git checkout-index --stage=all --temp -- path0 >out &&
|
||||||
test $(wc -l <out) = 0'
|
test_line_count = 0 out'
|
||||||
|
|
||||||
test_expect_success \
|
test_expect_success \
|
||||||
'checkout all stages/one file to temporary files' '
|
'checkout all stages/one file to temporary files' '
|
||||||
rm -f path* .merge_* out &&
|
rm -f path* .merge_* out &&
|
||||||
git checkout-index --stage=all --temp -- path1 >out &&
|
git checkout-index --stage=all --temp -- path1 >out &&
|
||||||
test $(wc -l <out) = 1 &&
|
test_line_count = 1 out &&
|
||||||
test $(cut "-d " -f2 out) = path1 &&
|
test $(cut "-d " -f2 out) = path1 &&
|
||||||
cut "-d " -f1 out | (read s1 s2 s3 &&
|
cut "-d " -f1 out | (read s1 s2 s3 &&
|
||||||
test -f $s1 &&
|
test -f $s1 &&
|
||||||
@ -112,7 +112,7 @@ test_expect_success \
|
|||||||
'checkout some stages/one file to temporary files' '
|
'checkout some stages/one file to temporary files' '
|
||||||
rm -f path* .merge_* out &&
|
rm -f path* .merge_* out &&
|
||||||
git checkout-index --stage=all --temp -- path2 >out &&
|
git checkout-index --stage=all --temp -- path2 >out &&
|
||||||
test $(wc -l <out) = 1 &&
|
test_line_count = 1 out &&
|
||||||
test $(cut "-d " -f2 out) = path2 &&
|
test $(cut "-d " -f2 out) = path2 &&
|
||||||
cut "-d " -f1 out | (read s1 s2 s3 &&
|
cut "-d " -f1 out | (read s1 s2 s3 &&
|
||||||
test $s1 = . &&
|
test $s1 = . &&
|
||||||
@ -125,7 +125,7 @@ test_expect_success \
|
|||||||
'checkout all stages/all files to temporary files' '
|
'checkout all stages/all files to temporary files' '
|
||||||
rm -f path* .merge_* out &&
|
rm -f path* .merge_* out &&
|
||||||
git checkout-index -a --stage=all --temp >out &&
|
git checkout-index -a --stage=all --temp >out &&
|
||||||
test $(wc -l <out) = 5'
|
test_line_count = 5 out'
|
||||||
|
|
||||||
test_expect_success \
|
test_expect_success \
|
||||||
'-- path0: no entry' '
|
'-- path0: no entry' '
|
||||||
@ -185,7 +185,7 @@ test_expect_success \
|
|||||||
'checkout --temp within subdir' '
|
'checkout --temp within subdir' '
|
||||||
(cd asubdir &&
|
(cd asubdir &&
|
||||||
git checkout-index -a --stage=all >out &&
|
git checkout-index -a --stage=all >out &&
|
||||||
test $(wc -l <out) = 1 &&
|
test_line_count = 1 out &&
|
||||||
test $(grep path5 out | cut "-d " -f2) = path5 &&
|
test $(grep path5 out | cut "-d " -f2) = path5 &&
|
||||||
grep path5 out | cut "-d " -f1 | (read s1 s2 s3 &&
|
grep path5 out | cut "-d " -f1 | (read s1 s2 s3 &&
|
||||||
test -f ../$s1 &&
|
test -f ../$s1 &&
|
||||||
@ -203,7 +203,7 @@ t4=$(git write-tree) &&
|
|||||||
rm -f .git/index &&
|
rm -f .git/index &&
|
||||||
git read-tree $t4 &&
|
git read-tree $t4 &&
|
||||||
git checkout-index --temp -a >out &&
|
git checkout-index --temp -a >out &&
|
||||||
test $(wc -l <out) = 1 &&
|
test_line_count = 1 out &&
|
||||||
test $(cut "-d " -f2 out) = a &&
|
test $(cut "-d " -f2 out) = a &&
|
||||||
p=$(cut "-d " -f1 out) &&
|
p=$(cut "-d " -f1 out) &&
|
||||||
test -f $p &&
|
test -f $p &&
|
||||||
|
@ -113,7 +113,7 @@ test_expect_success 'unmerge with plumbing' '
|
|||||||
prime_resolve_undo &&
|
prime_resolve_undo &&
|
||||||
git update-index --unresolve fi/le &&
|
git update-index --unresolve fi/le &&
|
||||||
git ls-files -u >actual &&
|
git ls-files -u >actual &&
|
||||||
test $(wc -l <actual) = 3
|
test_line_count = 3 actual
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'rerere and rerere forget' '
|
test_expect_success 'rerere and rerere forget' '
|
||||||
|
@ -33,7 +33,7 @@ test_auto_fixup () {
|
|||||||
test_tick &&
|
test_tick &&
|
||||||
git rebase $2 -i HEAD^^^ &&
|
git rebase $2 -i HEAD^^^ &&
|
||||||
git log --oneline >actual &&
|
git log --oneline >actual &&
|
||||||
test 3 = $(wc -l <actual) &&
|
test_line_count = 3 actual &&
|
||||||
git diff --exit-code $1 &&
|
git diff --exit-code $1 &&
|
||||||
test 1 = "$(git cat-file blob HEAD^:file1)" &&
|
test 1 = "$(git cat-file blob HEAD^:file1)" &&
|
||||||
test 1 = $(git cat-file commit HEAD^ | grep first | wc -l)
|
test 1 = $(git cat-file commit HEAD^ | grep first | wc -l)
|
||||||
@ -62,7 +62,7 @@ test_auto_squash () {
|
|||||||
test_tick &&
|
test_tick &&
|
||||||
git rebase $2 -i HEAD^^^ &&
|
git rebase $2 -i HEAD^^^ &&
|
||||||
git log --oneline >actual &&
|
git log --oneline >actual &&
|
||||||
test 3 = $(wc -l <actual) &&
|
test_line_count = 3 actual &&
|
||||||
git diff --exit-code $1 &&
|
git diff --exit-code $1 &&
|
||||||
test 1 = "$(git cat-file blob HEAD^:file1)" &&
|
test 1 = "$(git cat-file blob HEAD^:file1)" &&
|
||||||
test 2 = $(git cat-file commit HEAD^ | grep first | wc -l)
|
test 2 = $(git cat-file commit HEAD^ | grep first | wc -l)
|
||||||
@ -90,7 +90,7 @@ test_expect_success 'misspelled auto squash' '
|
|||||||
test_tick &&
|
test_tick &&
|
||||||
git rebase --autosquash -i HEAD^^^ &&
|
git rebase --autosquash -i HEAD^^^ &&
|
||||||
git log --oneline >actual &&
|
git log --oneline >actual &&
|
||||||
test 4 = $(wc -l <actual) &&
|
test_line_count = 4 actual &&
|
||||||
git diff --exit-code final-missquash &&
|
git diff --exit-code final-missquash &&
|
||||||
test 0 = $(git rev-list final-missquash...HEAD | wc -l)
|
test 0 = $(git rev-list final-missquash...HEAD | wc -l)
|
||||||
'
|
'
|
||||||
@ -109,7 +109,7 @@ test_expect_success 'auto squash that matches 2 commits' '
|
|||||||
test_tick &&
|
test_tick &&
|
||||||
git rebase --autosquash -i HEAD~4 &&
|
git rebase --autosquash -i HEAD~4 &&
|
||||||
git log --oneline >actual &&
|
git log --oneline >actual &&
|
||||||
test 4 = $(wc -l <actual) &&
|
test_line_count = 4 actual &&
|
||||||
git diff --exit-code final-multisquash &&
|
git diff --exit-code final-multisquash &&
|
||||||
test 1 = "$(git cat-file blob HEAD^^:file1)" &&
|
test 1 = "$(git cat-file blob HEAD^^:file1)" &&
|
||||||
test 2 = $(git cat-file commit HEAD^^ | grep first | wc -l) &&
|
test 2 = $(git cat-file commit HEAD^^ | grep first | wc -l) &&
|
||||||
@ -130,7 +130,7 @@ test_expect_success 'auto squash that matches a commit after the squash' '
|
|||||||
test_tick &&
|
test_tick &&
|
||||||
git rebase --autosquash -i HEAD~4 &&
|
git rebase --autosquash -i HEAD~4 &&
|
||||||
git log --oneline >actual &&
|
git log --oneline >actual &&
|
||||||
test 5 = $(wc -l <actual) &&
|
test_line_count = 5 actual &&
|
||||||
git diff --exit-code final-presquash &&
|
git diff --exit-code final-presquash &&
|
||||||
test 0 = "$(git cat-file blob HEAD^^:file1)" &&
|
test 0 = "$(git cat-file blob HEAD^^:file1)" &&
|
||||||
test 1 = "$(git cat-file blob HEAD^:file1)" &&
|
test 1 = "$(git cat-file blob HEAD^:file1)" &&
|
||||||
@ -147,7 +147,7 @@ test_expect_success 'auto squash that matches a sha1' '
|
|||||||
test_tick &&
|
test_tick &&
|
||||||
git rebase --autosquash -i HEAD^^^ &&
|
git rebase --autosquash -i HEAD^^^ &&
|
||||||
git log --oneline >actual &&
|
git log --oneline >actual &&
|
||||||
test 3 = $(wc -l <actual) &&
|
test_line_count = 3 actual &&
|
||||||
git diff --exit-code final-shasquash &&
|
git diff --exit-code final-shasquash &&
|
||||||
test 1 = "$(git cat-file blob HEAD^:file1)" &&
|
test 1 = "$(git cat-file blob HEAD^:file1)" &&
|
||||||
test 1 = $(git cat-file commit HEAD^ | grep squash | wc -l)
|
test 1 = $(git cat-file commit HEAD^ | grep squash | wc -l)
|
||||||
@ -163,7 +163,7 @@ test_expect_success 'auto squash that matches longer sha1' '
|
|||||||
test_tick &&
|
test_tick &&
|
||||||
git rebase --autosquash -i HEAD^^^ &&
|
git rebase --autosquash -i HEAD^^^ &&
|
||||||
git log --oneline >actual &&
|
git log --oneline >actual &&
|
||||||
test 3 = $(wc -l <actual) &&
|
test_line_count = 3 actual &&
|
||||||
git diff --exit-code final-longshasquash &&
|
git diff --exit-code final-longshasquash &&
|
||||||
test 1 = "$(git cat-file blob HEAD^:file1)" &&
|
test 1 = "$(git cat-file blob HEAD^:file1)" &&
|
||||||
test 1 = $(git cat-file commit HEAD^ | grep squash | wc -l)
|
test 1 = $(git cat-file commit HEAD^ | grep squash | wc -l)
|
||||||
@ -179,7 +179,7 @@ test_auto_commit_flags () {
|
|||||||
test_tick &&
|
test_tick &&
|
||||||
git rebase --autosquash -i HEAD^^^ &&
|
git rebase --autosquash -i HEAD^^^ &&
|
||||||
git log --oneline >actual &&
|
git log --oneline >actual &&
|
||||||
test 3 = $(wc -l <actual) &&
|
test_line_count = 3 actual &&
|
||||||
git diff --exit-code final-commit-$1 &&
|
git diff --exit-code final-commit-$1 &&
|
||||||
test 1 = "$(git cat-file blob HEAD^:file1)" &&
|
test 1 = "$(git cat-file blob HEAD^:file1)" &&
|
||||||
test $2 = $(git cat-file commit HEAD^ | grep first | wc -l)
|
test $2 = $(git cat-file commit HEAD^ | grep first | wc -l)
|
||||||
|
@ -160,7 +160,7 @@ test_commit_autosquash_flags () {
|
|||||||
git config --unset-all i18n.commitencoding &&
|
git config --unset-all i18n.commitencoding &&
|
||||||
git rebase --autosquash -i HEAD^^^ &&
|
git rebase --autosquash -i HEAD^^^ &&
|
||||||
git log --oneline >actual &&
|
git log --oneline >actual &&
|
||||||
test 3 = $(wc -l <actual)
|
test_line_count = 3 actual
|
||||||
'
|
'
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -15,65 +15,65 @@ test_expect_success 'setup' '
|
|||||||
|
|
||||||
test_expect_success 'git diff-tree HEAD^ HEAD' '
|
test_expect_success 'git diff-tree HEAD^ HEAD' '
|
||||||
git diff-tree --quiet HEAD^ HEAD >cnt
|
git diff-tree --quiet HEAD^ HEAD >cnt
|
||||||
test $? = 1 && test $(wc -l <cnt) = 0
|
test $? = 1 && test_line_count = 0 cnt
|
||||||
'
|
'
|
||||||
test_expect_success 'git diff-tree HEAD^ HEAD -- a' '
|
test_expect_success 'git diff-tree HEAD^ HEAD -- a' '
|
||||||
git diff-tree --quiet HEAD^ HEAD -- a >cnt
|
git diff-tree --quiet HEAD^ HEAD -- a >cnt
|
||||||
test $? = 0 && test $(wc -l <cnt) = 0
|
test $? = 0 && test_line_count = 0 cnt
|
||||||
'
|
'
|
||||||
test_expect_success 'git diff-tree HEAD^ HEAD -- b' '
|
test_expect_success 'git diff-tree HEAD^ HEAD -- b' '
|
||||||
git diff-tree --quiet HEAD^ HEAD -- b >cnt
|
git diff-tree --quiet HEAD^ HEAD -- b >cnt
|
||||||
test $? = 1 && test $(wc -l <cnt) = 0
|
test $? = 1 && test_line_count = 0 cnt
|
||||||
'
|
'
|
||||||
# this diff outputs one line: sha1 of the given head
|
# this diff outputs one line: sha1 of the given head
|
||||||
test_expect_success 'echo HEAD | git diff-tree --stdin' '
|
test_expect_success 'echo HEAD | git diff-tree --stdin' '
|
||||||
echo $(git rev-parse HEAD) | git diff-tree --quiet --stdin >cnt
|
echo $(git rev-parse HEAD) | git diff-tree --quiet --stdin >cnt
|
||||||
test $? = 1 && test $(wc -l <cnt) = 1
|
test $? = 1 && test_line_count = 1 cnt
|
||||||
'
|
'
|
||||||
test_expect_success 'git diff-tree HEAD HEAD' '
|
test_expect_success 'git diff-tree HEAD HEAD' '
|
||||||
git diff-tree --quiet HEAD HEAD >cnt
|
git diff-tree --quiet HEAD HEAD >cnt
|
||||||
test $? = 0 && test $(wc -l <cnt) = 0
|
test $? = 0 && test_line_count = 0 cnt
|
||||||
'
|
'
|
||||||
test_expect_success 'git diff-files' '
|
test_expect_success 'git diff-files' '
|
||||||
git diff-files --quiet >cnt
|
git diff-files --quiet >cnt
|
||||||
test $? = 0 && test $(wc -l <cnt) = 0
|
test $? = 0 && test_line_count = 0 cnt
|
||||||
'
|
'
|
||||||
test_expect_success 'git diff-index --cached HEAD' '
|
test_expect_success 'git diff-index --cached HEAD' '
|
||||||
git diff-index --quiet --cached HEAD >cnt
|
git diff-index --quiet --cached HEAD >cnt
|
||||||
test $? = 0 && test $(wc -l <cnt) = 0
|
test $? = 0 && test_line_count = 0 cnt
|
||||||
'
|
'
|
||||||
test_expect_success 'git diff-index --cached HEAD^' '
|
test_expect_success 'git diff-index --cached HEAD^' '
|
||||||
git diff-index --quiet --cached HEAD^ >cnt
|
git diff-index --quiet --cached HEAD^ >cnt
|
||||||
test $? = 1 && test $(wc -l <cnt) = 0
|
test $? = 1 && test_line_count = 0 cnt
|
||||||
'
|
'
|
||||||
test_expect_success 'git diff-index --cached HEAD^' '
|
test_expect_success 'git diff-index --cached HEAD^' '
|
||||||
echo text >>b &&
|
echo text >>b &&
|
||||||
echo 3 >c &&
|
echo 3 >c &&
|
||||||
git add . && {
|
git add . && {
|
||||||
git diff-index --quiet --cached HEAD^ >cnt
|
git diff-index --quiet --cached HEAD^ >cnt
|
||||||
test $? = 1 && test $(wc -l <cnt) = 0
|
test $? = 1 && test_line_count = 0 cnt
|
||||||
}
|
}
|
||||||
'
|
'
|
||||||
test_expect_success 'git diff-tree -Stext HEAD^ HEAD -- b' '
|
test_expect_success 'git diff-tree -Stext HEAD^ HEAD -- b' '
|
||||||
git commit -m "text in b" && {
|
git commit -m "text in b" && {
|
||||||
git diff-tree --quiet -Stext HEAD^ HEAD -- b >cnt
|
git diff-tree --quiet -Stext HEAD^ HEAD -- b >cnt
|
||||||
test $? = 1 && test $(wc -l <cnt) = 0
|
test $? = 1 && test_line_count = 0 cnt
|
||||||
}
|
}
|
||||||
'
|
'
|
||||||
test_expect_success 'git diff-tree -Snot-found HEAD^ HEAD -- b' '
|
test_expect_success 'git diff-tree -Snot-found HEAD^ HEAD -- b' '
|
||||||
git diff-tree --quiet -Snot-found HEAD^ HEAD -- b >cnt
|
git diff-tree --quiet -Snot-found HEAD^ HEAD -- b >cnt
|
||||||
test $? = 0 && test $(wc -l <cnt) = 0
|
test $? = 0 && test_line_count = 0 cnt
|
||||||
'
|
'
|
||||||
test_expect_success 'git diff-files' '
|
test_expect_success 'git diff-files' '
|
||||||
echo 3 >>c && {
|
echo 3 >>c && {
|
||||||
git diff-files --quiet >cnt
|
git diff-files --quiet >cnt
|
||||||
test $? = 1 && test $(wc -l <cnt) = 0
|
test $? = 1 && test_line_count = 0 cnt
|
||||||
}
|
}
|
||||||
'
|
'
|
||||||
test_expect_success 'git diff-index --cached HEAD' '
|
test_expect_success 'git diff-index --cached HEAD' '
|
||||||
git update-index c && {
|
git update-index c && {
|
||||||
git diff-index --quiet --cached HEAD >cnt
|
git diff-index --quiet --cached HEAD >cnt
|
||||||
test $? = 1 && test $(wc -l <cnt) = 0
|
test $? = 1 && test_line_count = 0 cnt
|
||||||
}
|
}
|
||||||
'
|
'
|
||||||
|
|
||||||
|
@ -65,7 +65,7 @@ test_expect_success 'respect NULs' '
|
|||||||
git mailsplit -d3 -o. "$TEST_DIRECTORY"/t5100/nul-plain &&
|
git mailsplit -d3 -o. "$TEST_DIRECTORY"/t5100/nul-plain &&
|
||||||
test_cmp "$TEST_DIRECTORY"/t5100/nul-plain 001 &&
|
test_cmp "$TEST_DIRECTORY"/t5100/nul-plain 001 &&
|
||||||
(cat 001 | git mailinfo msg patch) &&
|
(cat 001 | git mailinfo msg patch) &&
|
||||||
test 4 = $(wc -l < patch)
|
test_line_count = 4 patch
|
||||||
|
|
||||||
'
|
'
|
||||||
|
|
||||||
|
@ -34,7 +34,7 @@ test_expect_success 'cloning with reference (-l -s)' \
|
|||||||
cd "$base_dir"
|
cd "$base_dir"
|
||||||
|
|
||||||
test_expect_success 'existence of info/alternates' \
|
test_expect_success 'existence of info/alternates' \
|
||||||
'test `wc -l <C/.git/objects/info/alternates` = 2'
|
'test_line_count = 2 C/.git/objects/info/alternates'
|
||||||
|
|
||||||
cd "$base_dir"
|
cd "$base_dir"
|
||||||
|
|
||||||
@ -63,7 +63,7 @@ test_expect_success 'fetched no objects' \
|
|||||||
cd "$base_dir"
|
cd "$base_dir"
|
||||||
|
|
||||||
test_expect_success 'existence of info/alternates' \
|
test_expect_success 'existence of info/alternates' \
|
||||||
'test `wc -l <D/.git/objects/info/alternates` = 1'
|
'test_line_count = 1 D/.git/objects/info/alternates'
|
||||||
|
|
||||||
cd "$base_dir"
|
cd "$base_dir"
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ reachable_via() {
|
|||||||
|
|
||||||
test_valid_repo() {
|
test_valid_repo() {
|
||||||
git fsck --full > fsck.log &&
|
git fsck --full > fsck.log &&
|
||||||
test `wc -l < fsck.log` = 0
|
test_line_count = 0 fsck.log
|
||||||
}
|
}
|
||||||
|
|
||||||
base_dir=`pwd`
|
base_dir=`pwd`
|
||||||
|
@ -188,23 +188,23 @@ test_expect_success 'empty email' '
|
|||||||
|
|
||||||
test_expect_success 'del LF before empty (1)' '
|
test_expect_success 'del LF before empty (1)' '
|
||||||
git show -s --pretty=format:"%s%n%-b%nThanks%n" HEAD^^ >actual &&
|
git show -s --pretty=format:"%s%n%-b%nThanks%n" HEAD^^ >actual &&
|
||||||
test $(wc -l <actual) = 2
|
test_line_count = 2 actual
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'del LF before empty (2)' '
|
test_expect_success 'del LF before empty (2)' '
|
||||||
git show -s --pretty=format:"%s%n%-b%nThanks%n" HEAD >actual &&
|
git show -s --pretty=format:"%s%n%-b%nThanks%n" HEAD >actual &&
|
||||||
test $(wc -l <actual) = 6 &&
|
test_line_count = 6 actual &&
|
||||||
grep "^$" actual
|
grep "^$" actual
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'add LF before non-empty (1)' '
|
test_expect_success 'add LF before non-empty (1)' '
|
||||||
git show -s --pretty=format:"%s%+b%nThanks%n" HEAD^^ >actual &&
|
git show -s --pretty=format:"%s%+b%nThanks%n" HEAD^^ >actual &&
|
||||||
test $(wc -l <actual) = 2
|
test_line_count = 2 actual
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'add LF before non-empty (2)' '
|
test_expect_success 'add LF before non-empty (2)' '
|
||||||
git show -s --pretty=format:"%s%+b%nThanks%n" HEAD >actual &&
|
git show -s --pretty=format:"%s%+b%nThanks%n" HEAD >actual &&
|
||||||
test $(wc -l <actual) = 6 &&
|
test_line_count = 6 actual &&
|
||||||
grep "^$" actual
|
grep "^$" actual
|
||||||
'
|
'
|
||||||
|
|
||||||
@ -278,8 +278,9 @@ test_expect_success 'oneline with empty message' '
|
|||||||
git commit -m "dummy" --allow-empty &&
|
git commit -m "dummy" --allow-empty &&
|
||||||
git filter-branch --msg-filter "sed -e s/dummy//" HEAD^^.. &&
|
git filter-branch --msg-filter "sed -e s/dummy//" HEAD^^.. &&
|
||||||
git rev-list --oneline HEAD >test.txt &&
|
git rev-list --oneline HEAD >test.txt &&
|
||||||
test $(git rev-list --oneline HEAD | wc -l) -eq 5 &&
|
test_line_count = 5 test.txt &&
|
||||||
test $(git rev-list --oneline --graph HEAD | wc -l) -eq 5
|
git rev-list --oneline --graph HEAD >testg.txt &&
|
||||||
|
test_line_count = 5 testg.txt
|
||||||
'
|
'
|
||||||
|
|
||||||
test_done
|
test_done
|
||||||
|
@ -480,7 +480,7 @@ test_expect_success 'many merge bases creation' '
|
|||||||
git merge -m "merge HASH7 and SIDE_HASH7" "$HASH7" &&
|
git merge -m "merge HASH7 and SIDE_HASH7" "$HASH7" &&
|
||||||
B_HASH=$(git rev-parse --verify HEAD) &&
|
B_HASH=$(git rev-parse --verify HEAD) &&
|
||||||
git merge-base --all "$A_HASH" "$B_HASH" > merge_bases.txt &&
|
git merge-base --all "$A_HASH" "$B_HASH" > merge_bases.txt &&
|
||||||
test $(wc -l < merge_bases.txt) = "2" &&
|
test_line_count = 2 merge_bases.txt &&
|
||||||
grep "$HASH5" merge_bases.txt &&
|
grep "$HASH5" merge_bases.txt &&
|
||||||
grep "$SIDE_HASH5" merge_bases.txt
|
grep "$SIDE_HASH5" merge_bases.txt
|
||||||
'
|
'
|
||||||
|
@ -97,7 +97,7 @@ test_expect_success 'setup large simple rename' '
|
|||||||
test_expect_success 'massive simple rename does not spam added files' '
|
test_expect_success 'massive simple rename does not spam added files' '
|
||||||
sane_unset GIT_MERGE_VERBOSITY &&
|
sane_unset GIT_MERGE_VERBOSITY &&
|
||||||
git merge --no-stat simple-rename | grep -v Removing >output &&
|
git merge --no-stat simple-rename | grep -v Removing >output &&
|
||||||
test 5 -gt "$(wc -l < output)"
|
test_line_count -lt 5 output
|
||||||
'
|
'
|
||||||
|
|
||||||
test_done
|
test_done
|
||||||
|
@ -104,7 +104,7 @@ test_expect_failure 'conflict caused if rename not detected' '
|
|||||||
test 0 -eq $(git ls-files -u | wc -l) &&
|
test 0 -eq $(git ls-files -u | wc -l) &&
|
||||||
test 0 -eq $(git ls-files -o | wc -l) &&
|
test 0 -eq $(git ls-files -o | wc -l) &&
|
||||||
|
|
||||||
test 6 -eq $(wc -l < c) &&
|
test_line_count = 6 c &&
|
||||||
test $(git rev-parse HEAD:a) = $(git rev-parse B:a) &&
|
test $(git rev-parse HEAD:a) = $(git rev-parse B:a) &&
|
||||||
test $(git rev-parse HEAD:b) = $(git rev-parse A:b)
|
test $(git rev-parse HEAD:b) = $(git rev-parse A:b)
|
||||||
'
|
'
|
||||||
|
@ -229,7 +229,7 @@ test_expect_success 'checkout to detach HEAD (with advice declined)' '
|
|||||||
git checkout -f renamer && git clean -f &&
|
git checkout -f renamer && git clean -f &&
|
||||||
git checkout renamer^ 2>messages &&
|
git checkout renamer^ 2>messages &&
|
||||||
test_i18ngrep "HEAD is now at 7329388" messages &&
|
test_i18ngrep "HEAD is now at 7329388" messages &&
|
||||||
test 1 -eq $(wc -l <messages) &&
|
test_line_count = 1 messages &&
|
||||||
H=$(git rev-parse --verify HEAD) &&
|
H=$(git rev-parse --verify HEAD) &&
|
||||||
M=$(git show-ref -s --verify refs/heads/master) &&
|
M=$(git show-ref -s --verify refs/heads/master) &&
|
||||||
test "z$H" = "z$M" &&
|
test "z$H" = "z$M" &&
|
||||||
@ -247,7 +247,7 @@ test_expect_success 'checkout to detach HEAD' '
|
|||||||
git checkout -f renamer && git clean -f &&
|
git checkout -f renamer && git clean -f &&
|
||||||
git checkout renamer^ 2>messages &&
|
git checkout renamer^ 2>messages &&
|
||||||
test_i18ngrep "HEAD is now at 7329388" messages &&
|
test_i18ngrep "HEAD is now at 7329388" messages &&
|
||||||
test 1 -lt $(wc -l <messages) &&
|
test_line_count -gt 1 messages &&
|
||||||
H=$(git rev-parse --verify HEAD) &&
|
H=$(git rev-parse --verify HEAD) &&
|
||||||
M=$(git show-ref -s --verify refs/heads/master) &&
|
M=$(git show-ref -s --verify refs/heads/master) &&
|
||||||
test "z$H" = "z$M" &&
|
test "z$H" = "z$M" &&
|
||||||
|
@ -234,7 +234,7 @@ EOF
|
|||||||
|
|
||||||
test_expect_success 'status should only print one line' '
|
test_expect_success 'status should only print one line' '
|
||||||
git submodule status >lines &&
|
git submodule status >lines &&
|
||||||
test $(wc -l <lines) = 1
|
test_line_count = 1 lines
|
||||||
'
|
'
|
||||||
|
|
||||||
test_expect_success 'setup - fetch commit name from submodule' '
|
test_expect_success 'setup - fetch commit name from submodule' '
|
||||||
|
@ -43,7 +43,7 @@ git commit -m B-super-added'
|
|||||||
cd "$base_dir"
|
cd "$base_dir"
|
||||||
|
|
||||||
test_expect_success 'after add: existence of info/alternates' \
|
test_expect_success 'after add: existence of info/alternates' \
|
||||||
'test `wc -l <super/.git/modules/sub/objects/info/alternates` = 1'
|
'test_line_count = 1 super/.git/modules/sub/objects/info/alternates'
|
||||||
|
|
||||||
cd "$base_dir"
|
cd "$base_dir"
|
||||||
|
|
||||||
@ -66,7 +66,7 @@ test_expect_success 'update with reference' \
|
|||||||
cd "$base_dir"
|
cd "$base_dir"
|
||||||
|
|
||||||
test_expect_success 'after update: existence of info/alternates' \
|
test_expect_success 'after update: existence of info/alternates' \
|
||||||
'test `wc -l <super-clone/.git/modules/sub/objects/info/alternates` = 1'
|
'test_line_count = 1 super-clone/.git/modules/sub/objects/info/alternates'
|
||||||
|
|
||||||
cd "$base_dir"
|
cd "$base_dir"
|
||||||
|
|
||||||
|
@ -335,7 +335,7 @@ test_expect_success 'A single-liner subject with a token plus colon is not a foo
|
|||||||
git reset --hard &&
|
git reset --hard &&
|
||||||
git commit -s -m "hello: kitty" --allow-empty &&
|
git commit -s -m "hello: kitty" --allow-empty &&
|
||||||
git cat-file commit HEAD | sed -e "1,/^$/d" >actual &&
|
git cat-file commit HEAD | sed -e "1,/^$/d" >actual &&
|
||||||
test $(wc -l <actual) = 3
|
test_line_count = 3 actual
|
||||||
|
|
||||||
'
|
'
|
||||||
|
|
||||||
|
@ -86,7 +86,7 @@ test_expect_success 'import/export-marks' '
|
|||||||
git checkout -b marks master &&
|
git checkout -b marks master &&
|
||||||
git fast-export --export-marks=tmp-marks HEAD &&
|
git fast-export --export-marks=tmp-marks HEAD &&
|
||||||
test -s tmp-marks &&
|
test -s tmp-marks &&
|
||||||
test $(wc -l < tmp-marks) -eq 3 &&
|
test_line_count = 3 tmp-marks &&
|
||||||
test $(
|
test $(
|
||||||
git fast-export --import-marks=tmp-marks\
|
git fast-export --import-marks=tmp-marks\
|
||||||
--export-marks=tmp-marks HEAD |
|
--export-marks=tmp-marks HEAD |
|
||||||
@ -101,7 +101,7 @@ test_expect_success 'import/export-marks' '
|
|||||||
grep ^commit\ |
|
grep ^commit\ |
|
||||||
wc -l) \
|
wc -l) \
|
||||||
-eq 1 &&
|
-eq 1 &&
|
||||||
test $(wc -l < tmp-marks) -eq 4
|
test_line_count = 4 tmp-marks
|
||||||
|
|
||||||
'
|
'
|
||||||
|
|
||||||
|
@ -476,14 +476,14 @@ test_expect_success 'cvs status' '
|
|||||||
cd cvswork &&
|
cd cvswork &&
|
||||||
GIT_CONFIG="$git_config" cvs update &&
|
GIT_CONFIG="$git_config" cvs update &&
|
||||||
GIT_CONFIG="$git_config" cvs status | grep "^File: status.file" >../out &&
|
GIT_CONFIG="$git_config" cvs status | grep "^File: status.file" >../out &&
|
||||||
test $(wc -l <../out) = 2
|
test_line_count = 2 ../out
|
||||||
'
|
'
|
||||||
|
|
||||||
cd "$WORKDIR"
|
cd "$WORKDIR"
|
||||||
test_expect_success 'cvs status (nonrecursive)' '
|
test_expect_success 'cvs status (nonrecursive)' '
|
||||||
cd cvswork &&
|
cd cvswork &&
|
||||||
GIT_CONFIG="$git_config" cvs status -l | grep "^File: status.file" >../out &&
|
GIT_CONFIG="$git_config" cvs status -l | grep "^File: status.file" >../out &&
|
||||||
test $(wc -l <../out) = 1
|
test_line_count = 1 ../out
|
||||||
'
|
'
|
||||||
|
|
||||||
cd "$WORKDIR"
|
cd "$WORKDIR"
|
||||||
|
Loading…
Reference in New Issue
Block a user