t6000-t9999: detect and signal failure within loop
Failures within `for` and `while` loops can go unnoticed if not detected and signaled manually since the loop itself does not abort when a contained command fails, nor will a failure necessarily be detected when the loop finishes since the loop returns the exit code of the last command it ran on the final iteration, which may not be the command which failed. Therefore, detect and signal failures manually within loops using the idiom `|| return 1` (or `|| exit 1` within subshells). Signed-off-by: Eric Sunshine <sunshine@sunshineco.com> Reviewed-by: Elijah Newren <newren@gmail.com> Signed-off-by: Junio C Hamano <gitster@pobox.com>
This commit is contained in:
parent
d0fd993137
commit
0c51d6b4ae
@ -12,7 +12,7 @@ test_expect_success 'creating page w/ >500 revisions' '
|
|||||||
for i in $(test_seq 501)
|
for i in $(test_seq 501)
|
||||||
do
|
do
|
||||||
echo "creating revision $i" &&
|
echo "creating revision $i" &&
|
||||||
wiki_editpage foo "revision $i<br/>" true
|
wiki_editpage foo "revision $i<br/>" true || return 1
|
||||||
done
|
done
|
||||||
'
|
'
|
||||||
|
|
||||||
|
@ -161,7 +161,7 @@ test_expect_success 'blame huge graft' '
|
|||||||
GIT_AUTHOR_NAME=$i$j GIT_AUTHOR_EMAIL=$i$j@test.git \
|
GIT_AUTHOR_NAME=$i$j GIT_AUTHOR_EMAIL=$i$j@test.git \
|
||||||
git commit -a -m "$i$j" &&
|
git commit -a -m "$i$j" &&
|
||||||
commit=$(git rev-parse --verify HEAD) &&
|
commit=$(git rev-parse --verify HEAD) &&
|
||||||
graft="$graft$commit "
|
graft="$graft$commit " || return 1
|
||||||
done
|
done
|
||||||
done &&
|
done &&
|
||||||
printf "%s " $graft >.git/info/grafts &&
|
printf "%s " $graft >.git/info/grafts &&
|
||||||
|
@ -8,7 +8,7 @@ test_expect_success 'setup' '
|
|||||||
for n in 1 2 3 4 5 ; do
|
for n in 1 2 3 4 5 ; do
|
||||||
echo $n > a &&
|
echo $n > a &&
|
||||||
git add a &&
|
git add a &&
|
||||||
git commit -m "$n"
|
git commit -m "$n" || return 1
|
||||||
done
|
done
|
||||||
'
|
'
|
||||||
|
|
||||||
|
@ -124,7 +124,7 @@ test_expect_success 'dodecapus' '
|
|||||||
git checkout -b root$i five &&
|
git checkout -b root$i five &&
|
||||||
test_commit $i &&
|
test_commit $i &&
|
||||||
roots="$roots root$i" ||
|
roots="$roots root$i" ||
|
||||||
return
|
return 1
|
||||||
done &&
|
done &&
|
||||||
git checkout main &&
|
git checkout main &&
|
||||||
test_tick &&
|
test_tick &&
|
||||||
@ -143,7 +143,7 @@ test_expect_success 'ancestors with the same commit time' '
|
|||||||
test_tick_keep=$test_tick &&
|
test_tick_keep=$test_tick &&
|
||||||
for i in 1 2 3 4 5 6 7 8; do
|
for i in 1 2 3 4 5 6 7 8; do
|
||||||
test_tick=$test_tick_keep &&
|
test_tick=$test_tick_keep &&
|
||||||
test_commit t$i
|
test_commit t$i || return 1
|
||||||
done &&
|
done &&
|
||||||
git rev-list t1^! --not t$i >result &&
|
git rev-list t1^! --not t$i >result &&
|
||||||
test_must_be_empty result
|
test_must_be_empty result
|
||||||
|
@ -32,7 +32,7 @@ test_expect_success 'setup' '
|
|||||||
test_tick &&
|
test_tick &&
|
||||||
git commit --allow-empty -m "$i" &&
|
git commit --allow-empty -m "$i" &&
|
||||||
commit=$(git rev-parse --verify HEAD) &&
|
commit=$(git rev-parse --verify HEAD) &&
|
||||||
printf "$commit " >>.git/info/grafts
|
printf "$commit " >>.git/info/grafts || return 1
|
||||||
done
|
done
|
||||||
'
|
'
|
||||||
|
|
||||||
|
@ -18,7 +18,7 @@ test_expect_success 'setup r1' '
|
|||||||
do
|
do
|
||||||
echo "This is file: $n" > r1/file.$n &&
|
echo "This is file: $n" > r1/file.$n &&
|
||||||
git -C r1 add file.$n &&
|
git -C r1 add file.$n &&
|
||||||
git -C r1 commit -m "$n"
|
git -C r1 commit -m "$n" || return 1
|
||||||
done
|
done
|
||||||
'
|
'
|
||||||
|
|
||||||
@ -75,7 +75,7 @@ test_expect_success 'setup r2' '
|
|||||||
do
|
do
|
||||||
printf "%"$n"s" X > r2/large.$n &&
|
printf "%"$n"s" X > r2/large.$n &&
|
||||||
git -C r2 add large.$n &&
|
git -C r2 add large.$n &&
|
||||||
git -C r2 commit -m "$n"
|
git -C r2 commit -m "$n" || return 1
|
||||||
done
|
done
|
||||||
'
|
'
|
||||||
|
|
||||||
@ -248,7 +248,7 @@ test_expect_success 'setup r3' '
|
|||||||
echo "This is file: $n" > r3/$n &&
|
echo "This is file: $n" > r3/$n &&
|
||||||
git -C r3 add $n &&
|
git -C r3 add $n &&
|
||||||
echo "This is file: dir1/$n" > r3/dir1/$n &&
|
echo "This is file: dir1/$n" > r3/dir1/$n &&
|
||||||
git -C r3 add dir1/$n
|
git -C r3 add dir1/$n || return 1
|
||||||
done &&
|
done &&
|
||||||
git -C r3 commit -m "sparse" &&
|
git -C r3 commit -m "sparse" &&
|
||||||
echo dir1/ >pattern1 &&
|
echo dir1/ >pattern1 &&
|
||||||
@ -672,7 +672,7 @@ test_expect_success 'rev-list W/ --missing=print' '
|
|||||||
|
|
||||||
for id in `cat expected | sed "s|..|&/|"`
|
for id in `cat expected | sed "s|..|&/|"`
|
||||||
do
|
do
|
||||||
rm r1/.git/objects/$id
|
rm r1/.git/objects/$id || return 1
|
||||||
done &&
|
done &&
|
||||||
|
|
||||||
git -C r1 rev-list --quiet --missing=print --objects HEAD >revs &&
|
git -C r1 rev-list --quiet --missing=print --objects HEAD >revs &&
|
||||||
|
@ -262,7 +262,7 @@ test_expect_success 'name-rev --all' '
|
|||||||
>expect.unsorted &&
|
>expect.unsorted &&
|
||||||
for rev in $(git rev-list --all)
|
for rev in $(git rev-list --all)
|
||||||
do
|
do
|
||||||
git name-rev $rev >>expect.unsorted
|
git name-rev $rev >>expect.unsorted || return 1
|
||||||
done &&
|
done &&
|
||||||
sort <expect.unsorted >expect &&
|
sort <expect.unsorted >expect &&
|
||||||
git name-rev --all >actual.unsorted &&
|
git name-rev --all >actual.unsorted &&
|
||||||
@ -275,7 +275,7 @@ test_expect_success 'name-rev --stdin' '
|
|||||||
for rev in $(git rev-list --all)
|
for rev in $(git rev-list --all)
|
||||||
do
|
do
|
||||||
name=$(git name-rev --name-only $rev) &&
|
name=$(git name-rev --name-only $rev) &&
|
||||||
echo "$rev ($name)" >>expect.unsorted
|
echo "$rev ($name)" >>expect.unsorted || return 1
|
||||||
done &&
|
done &&
|
||||||
sort <expect.unsorted >expect &&
|
sort <expect.unsorted >expect &&
|
||||||
git rev-list --all | git name-rev --stdin >actual.unsorted &&
|
git rev-list --all | git name-rev --stdin >actual.unsorted &&
|
||||||
@ -395,7 +395,7 @@ EOF" &&
|
|||||||
then
|
then
|
||||||
echo "from refs/heads/main^0"
|
echo "from refs/heads/main^0"
|
||||||
fi &&
|
fi &&
|
||||||
i=$(($i + 1))
|
i=$(($i + 1)) || return 1
|
||||||
done | git fast-import &&
|
done | git fast-import &&
|
||||||
git checkout main &&
|
git checkout main &&
|
||||||
git tag far-far-away HEAD^ &&
|
git tag far-far-away HEAD^ &&
|
||||||
|
@ -11,7 +11,7 @@ test_expect_success 'setup' '
|
|||||||
fi &&
|
fi &&
|
||||||
: >$p &&
|
: >$p &&
|
||||||
git add $p &&
|
git add $p &&
|
||||||
git commit -m $p
|
git commit -m $p || return 1
|
||||||
done &&
|
done &&
|
||||||
git log --oneline --format=%s >actual &&
|
git log --oneline --format=%s >actual &&
|
||||||
cat <<EOF >expect &&
|
cat <<EOF >expect &&
|
||||||
|
@ -519,7 +519,7 @@ test_expect_success 'merge-msg lots of commits' '
|
|||||||
while test $i -gt 9
|
while test $i -gt 9
|
||||||
do
|
do
|
||||||
echo " $i" &&
|
echo " $i" &&
|
||||||
i=$(($i-1))
|
i=$(($i-1)) || return 1
|
||||||
done &&
|
done &&
|
||||||
echo " ..."
|
echo " ..."
|
||||||
} >expected &&
|
} >expected &&
|
||||||
|
@ -1338,7 +1338,7 @@ test_expect_success ':remotename and :remoteref' '
|
|||||||
echo "${pair#*=}" >expect &&
|
echo "${pair#*=}" >expect &&
|
||||||
git for-each-ref --format="${pair%=*}" \
|
git for-each-ref --format="${pair%=*}" \
|
||||||
refs/heads/main >actual &&
|
refs/heads/main >actual &&
|
||||||
test_cmp expect actual
|
test_cmp expect actual || exit 1
|
||||||
done &&
|
done &&
|
||||||
git branch push-simple &&
|
git branch push-simple &&
|
||||||
git config branch.push-simple.pushRemote from &&
|
git config branch.push-simple.pushRemote from &&
|
||||||
|
@ -37,18 +37,18 @@ test_rename() {
|
|||||||
test_might_fail git branch -D test$n &&
|
test_might_fail git branch -D test$n &&
|
||||||
git reset --hard initial &&
|
git reset --hard initial &&
|
||||||
for i in $(count $n); do
|
for i in $(count $n); do
|
||||||
make_text $i initial initial >$i
|
make_text $i initial initial >$i || return 1
|
||||||
done &&
|
done &&
|
||||||
git add . &&
|
git add . &&
|
||||||
git commit -m add=$n &&
|
git commit -m add=$n &&
|
||||||
for i in $(count $n); do
|
for i in $(count $n); do
|
||||||
make_text $i changed initial >$i
|
make_text $i changed initial >$i || return 1
|
||||||
done &&
|
done &&
|
||||||
git commit -a -m change=$n &&
|
git commit -a -m change=$n &&
|
||||||
git checkout -b test$n HEAD^ &&
|
git checkout -b test$n HEAD^ &&
|
||||||
for i in $(count $n); do
|
for i in $(count $n); do
|
||||||
git rm $i &&
|
git rm $i &&
|
||||||
make_text $i initial changed >$i.moved
|
make_text $i initial changed >$i.moved || return 1
|
||||||
done &&
|
done &&
|
||||||
git add . &&
|
git add . &&
|
||||||
git commit -m change+rename=$n &&
|
git commit -m change+rename=$n &&
|
||||||
@ -79,7 +79,7 @@ test_expect_success 'setup large simple rename' '
|
|||||||
|
|
||||||
git reset --hard initial &&
|
git reset --hard initial &&
|
||||||
for i in $(count 200); do
|
for i in $(count 200); do
|
||||||
make_text foo bar baz >$i
|
make_text foo bar baz >$i || return 1
|
||||||
done &&
|
done &&
|
||||||
git add . &&
|
git add . &&
|
||||||
git commit -m create-files &&
|
git commit -m create-files &&
|
||||||
|
@ -706,7 +706,7 @@ test_expect_success 'merge-recursive remembers the names of all base trees' '
|
|||||||
# more trees than static slots used by oid_to_hex()
|
# more trees than static slots used by oid_to_hex()
|
||||||
for commit in $c0 $c2 $c4 $c5 $c6 $c7
|
for commit in $c0 $c2 $c4 $c5 $c6 $c7
|
||||||
do
|
do
|
||||||
git rev-parse "$commit^{tree}"
|
git rev-parse "$commit^{tree}" || return 1
|
||||||
done >trees &&
|
done >trees &&
|
||||||
|
|
||||||
# ignore the return code; it only fails because the input is weird...
|
# ignore the return code; it only fails because the input is weird...
|
||||||
|
@ -32,7 +32,7 @@ test_expect_success 'setup' '
|
|||||||
do
|
do
|
||||||
test_commit "1-$i" &&
|
test_commit "1-$i" &&
|
||||||
git branch -f commit-1-$i &&
|
git branch -f commit-1-$i &&
|
||||||
git tag -a -m "1-$i" tag-1-$i commit-1-$i
|
git tag -a -m "1-$i" tag-1-$i commit-1-$i || return 1
|
||||||
done &&
|
done &&
|
||||||
for j in $(test_seq 1 9)
|
for j in $(test_seq 1 9)
|
||||||
do
|
do
|
||||||
@ -46,7 +46,7 @@ test_expect_success 'setup' '
|
|||||||
do
|
do
|
||||||
git merge commit-$j-$i -m "$x-$i" &&
|
git merge commit-$j-$i -m "$x-$i" &&
|
||||||
git branch -f commit-$x-$i &&
|
git branch -f commit-$x-$i &&
|
||||||
git tag -a -m "$x-$i" tag-$x-$i commit-$x-$i
|
git tag -a -m "$x-$i" tag-$x-$i commit-$x-$i || return 1
|
||||||
done
|
done
|
||||||
done &&
|
done &&
|
||||||
git commit-graph write --reachable &&
|
git commit-graph write --reachable &&
|
||||||
|
@ -1981,7 +1981,7 @@ EOF" &&
|
|||||||
then
|
then
|
||||||
echo "from refs/heads/main^0"
|
echo "from refs/heads/main^0"
|
||||||
fi &&
|
fi &&
|
||||||
i=$(($i + 1))
|
i=$(($i + 1)) || return 1
|
||||||
done | git fast-import &&
|
done | git fast-import &&
|
||||||
git checkout main &&
|
git checkout main &&
|
||||||
git tag far-far-away HEAD^ &&
|
git tag far-far-away HEAD^ &&
|
||||||
|
@ -16,7 +16,7 @@ test_expect_success 'set up commits for rebasing' '
|
|||||||
test_commit rebase-b b bb &&
|
test_commit rebase-b b bb &&
|
||||||
for i in $(test_seq 1 13)
|
for i in $(test_seq 1 13)
|
||||||
do
|
do
|
||||||
test_commit rebase-$i c $i
|
test_commit rebase-$i c $i || return 1
|
||||||
done &&
|
done &&
|
||||||
git checkout main &&
|
git checkout main &&
|
||||||
|
|
||||||
|
@ -967,7 +967,7 @@ test_expect_success 'set up mod-256 conflict scenario' '
|
|||||||
# 256 near-identical stanzas...
|
# 256 near-identical stanzas...
|
||||||
for i in $(test_seq 1 256); do
|
for i in $(test_seq 1 256); do
|
||||||
for j in 1 2 3 4 5; do
|
for j in 1 2 3 4 5; do
|
||||||
echo $i-$j
|
echo $i-$j || return 1
|
||||||
done
|
done
|
||||||
done >file &&
|
done >file &&
|
||||||
git add file &&
|
git add file &&
|
||||||
|
@ -30,7 +30,7 @@ test_expect_success 'merge c1 with c2, c3, c4, ... c29' '
|
|||||||
while test $i -le 30
|
while test $i -le 30
|
||||||
do
|
do
|
||||||
refs="$refs c$i" &&
|
refs="$refs c$i" &&
|
||||||
i=$(expr $i + 1)
|
i=$(expr $i + 1) || return 1
|
||||||
done &&
|
done &&
|
||||||
git merge $refs &&
|
git merge $refs &&
|
||||||
test "$(git rev-parse c1)" != "$(git rev-parse HEAD)" &&
|
test "$(git rev-parse c1)" != "$(git rev-parse HEAD)" &&
|
||||||
|
@ -95,7 +95,7 @@ test_expect_success 'setup' '
|
|||||||
echo $i > $i.c &&
|
echo $i > $i.c &&
|
||||||
git add $i.c &&
|
git add $i.c &&
|
||||||
git commit -m $i &&
|
git commit -m $i &&
|
||||||
git tag $i
|
git tag $i || return 1
|
||||||
done &&
|
done &&
|
||||||
git reset --hard A &&
|
git reset --hard A &&
|
||||||
for i in F G H I
|
for i in F G H I
|
||||||
@ -103,7 +103,7 @@ test_expect_success 'setup' '
|
|||||||
echo $i > $i.c &&
|
echo $i > $i.c &&
|
||||||
git add $i.c &&
|
git add $i.c &&
|
||||||
git commit -m $i &&
|
git commit -m $i &&
|
||||||
git tag $i
|
git tag $i || return 1
|
||||||
done
|
done
|
||||||
'
|
'
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ test_expect_success 'packed obs in alternate ODB kept pack are repacked' '
|
|||||||
rm alt_objects/pack/$base_name.keep
|
rm alt_objects/pack/$base_name.keep
|
||||||
else
|
else
|
||||||
touch alt_objects/pack/$base_name.keep
|
touch alt_objects/pack/$base_name.keep
|
||||||
fi
|
fi || return 1
|
||||||
done &&
|
done &&
|
||||||
git repack -a -d &&
|
git repack -a -d &&
|
||||||
test_no_missing_in_packs
|
test_no_missing_in_packs
|
||||||
|
@ -310,7 +310,7 @@ test_expect_success setup '
|
|||||||
echo "$line" >>"$i" &&
|
echo "$line" >>"$i" &&
|
||||||
git add "$i" &&
|
git add "$i" &&
|
||||||
test_tick &&
|
test_tick &&
|
||||||
GIT_AUTHOR_NAME="$line_count" git commit -m "$line_count"
|
GIT_AUTHOR_NAME="$line_count" git commit -m "$line_count" || return 1
|
||||||
done <"a$i"
|
done <"a$i"
|
||||||
done &&
|
done &&
|
||||||
|
|
||||||
@ -318,7 +318,7 @@ test_expect_success setup '
|
|||||||
do
|
do
|
||||||
# Overwrite the files with the final content.
|
# Overwrite the files with the final content.
|
||||||
cp b$i $i &&
|
cp b$i $i &&
|
||||||
git add $i
|
git add $i || return 1
|
||||||
done &&
|
done &&
|
||||||
test_tick &&
|
test_tick &&
|
||||||
|
|
||||||
|
@ -117,7 +117,7 @@ test_expect_success 'follow-parent avoids deleting relevant info' '
|
|||||||
mkdir -p import/trunk/subversion/bindings/swig/perl/t &&
|
mkdir -p import/trunk/subversion/bindings/swig/perl/t &&
|
||||||
for i in a b c ; do \
|
for i in a b c ; do \
|
||||||
echo $i > import/trunk/subversion/bindings/swig/perl/$i.pm &&
|
echo $i > import/trunk/subversion/bindings/swig/perl/$i.pm &&
|
||||||
echo _$i > import/trunk/subversion/bindings/swig/perl/t/$i.t; \
|
echo _$i > import/trunk/subversion/bindings/swig/perl/t/$i.t || return 1
|
||||||
done &&
|
done &&
|
||||||
echo "bad delete test" > \
|
echo "bad delete test" > \
|
||||||
import/trunk/subversion/bindings/swig/perl/t/larger-parent &&
|
import/trunk/subversion/bindings/swig/perl/t/larger-parent &&
|
||||||
@ -134,7 +134,7 @@ test_expect_success 'follow-parent avoids deleting relevant info' '
|
|||||||
svn mv t native/t &&
|
svn mv t native/t &&
|
||||||
for i in a b c
|
for i in a b c
|
||||||
do
|
do
|
||||||
svn mv $i.pm native/$i.pm
|
svn mv $i.pm native/$i.pm || return 1
|
||||||
done &&
|
done &&
|
||||||
echo z >>native/t/c.t &&
|
echo z >>native/t/c.t &&
|
||||||
poke native/t/c.t &&
|
poke native/t/c.t &&
|
||||||
|
@ -15,7 +15,7 @@ EOF
|
|||||||
test_expect_success 'setup svnrepo' '
|
test_expect_success 'setup svnrepo' '
|
||||||
for i in aa bb cc dd
|
for i in aa bb cc dd
|
||||||
do
|
do
|
||||||
svn_cmd mkdir -m $i --username $i "$svnrepo"/$i
|
svn_cmd mkdir -m $i --username $i "$svnrepo"/$i || return 1
|
||||||
done
|
done
|
||||||
'
|
'
|
||||||
|
|
||||||
@ -60,7 +60,7 @@ test_expect_success 'authors-file against globs' '
|
|||||||
for i in bb ee cc
|
for i in bb ee cc
|
||||||
do
|
do
|
||||||
branch="aa/branches/$i" &&
|
branch="aa/branches/$i" &&
|
||||||
svn_cmd mkdir -m "$branch" --username $i "$svnrepo/$branch"
|
svn_cmd mkdir -m "$branch" --username $i "$svnrepo/$branch" || return 1
|
||||||
done
|
done
|
||||||
'
|
'
|
||||||
|
|
||||||
|
@ -27,7 +27,7 @@ test_expect_success 'setup test repository' '
|
|||||||
test_expect_success 'clone an SVN repository with ignored www directory' '
|
test_expect_success 'clone an SVN repository with ignored www directory' '
|
||||||
git svn clone --ignore-paths="^www" "$svnrepo" g &&
|
git svn clone --ignore-paths="^www" "$svnrepo" g &&
|
||||||
echo test_qqq > expect &&
|
echo test_qqq > expect &&
|
||||||
for i in g/*/*.txt; do cat $i >> expect2; done &&
|
for i in g/*/*.txt; do cat $i >> expect2 || return 1; done &&
|
||||||
test_cmp expect expect2
|
test_cmp expect expect2
|
||||||
'
|
'
|
||||||
|
|
||||||
@ -36,7 +36,7 @@ test_expect_success 'init+fetch an SVN repository with ignored www directory' '
|
|||||||
( cd c && git svn fetch --ignore-paths="^www" ) &&
|
( cd c && git svn fetch --ignore-paths="^www" ) &&
|
||||||
rm expect2 &&
|
rm expect2 &&
|
||||||
echo test_qqq > expect &&
|
echo test_qqq > expect &&
|
||||||
for i in c/*/*.txt; do cat $i >> expect2; done &&
|
for i in c/*/*.txt; do cat $i >> expect2 || return 1; done &&
|
||||||
test_cmp expect expect2
|
test_cmp expect expect2
|
||||||
'
|
'
|
||||||
|
|
||||||
@ -62,7 +62,7 @@ test_expect_success 'update git svn-cloned repo (config ignore)' '
|
|||||||
cd g &&
|
cd g &&
|
||||||
git svn rebase &&
|
git svn rebase &&
|
||||||
printf "test_qqq\nb\n" > expect &&
|
printf "test_qqq\nb\n" > expect &&
|
||||||
for i in */*.txt; do cat $i >> expect2; done &&
|
for i in */*.txt; do cat $i >> expect2 || exit 1; done &&
|
||||||
test_cmp expect2 expect &&
|
test_cmp expect2 expect &&
|
||||||
rm expect expect2
|
rm expect expect2
|
||||||
)
|
)
|
||||||
@ -73,7 +73,7 @@ test_expect_success 'update git svn-cloned repo (option ignore)' '
|
|||||||
cd c &&
|
cd c &&
|
||||||
git svn rebase --ignore-paths="^www" &&
|
git svn rebase --ignore-paths="^www" &&
|
||||||
printf "test_qqq\nb\n" > expect &&
|
printf "test_qqq\nb\n" > expect &&
|
||||||
for i in */*.txt; do cat $i >> expect2; done &&
|
for i in */*.txt; do cat $i >> expect2 || exit 1; done &&
|
||||||
test_cmp expect2 expect &&
|
test_cmp expect2 expect &&
|
||||||
rm expect expect2
|
rm expect expect2
|
||||||
)
|
)
|
||||||
@ -94,7 +94,7 @@ test_expect_success 'update git svn-cloned repo (config ignore)' '
|
|||||||
cd g &&
|
cd g &&
|
||||||
git svn rebase &&
|
git svn rebase &&
|
||||||
printf "test_qqq\nb\n" > expect &&
|
printf "test_qqq\nb\n" > expect &&
|
||||||
for i in */*.txt; do cat $i >> expect2; done &&
|
for i in */*.txt; do cat $i >> expect2 || exit 1; done &&
|
||||||
test_cmp expect2 expect &&
|
test_cmp expect2 expect &&
|
||||||
rm expect expect2
|
rm expect expect2
|
||||||
)
|
)
|
||||||
@ -105,7 +105,7 @@ test_expect_success 'update git svn-cloned repo (option ignore)' '
|
|||||||
cd c &&
|
cd c &&
|
||||||
git svn rebase --ignore-paths="^www" &&
|
git svn rebase --ignore-paths="^www" &&
|
||||||
printf "test_qqq\nb\n" > expect &&
|
printf "test_qqq\nb\n" > expect &&
|
||||||
for i in */*.txt; do cat $i >> expect2; done &&
|
for i in */*.txt; do cat $i >> expect2 || exit 1; done &&
|
||||||
test_cmp expect2 expect &&
|
test_cmp expect2 expect &&
|
||||||
rm expect expect2
|
rm expect expect2
|
||||||
)
|
)
|
||||||
@ -127,7 +127,7 @@ test_expect_success 'update git svn-cloned repo again (config ignore)' '
|
|||||||
cd g &&
|
cd g &&
|
||||||
git svn rebase &&
|
git svn rebase &&
|
||||||
printf "test_qqq\nb\nygg\n" > expect &&
|
printf "test_qqq\nb\nygg\n" > expect &&
|
||||||
for i in */*.txt; do cat $i >> expect2; done &&
|
for i in */*.txt; do cat $i >> expect2 || exit 1; done &&
|
||||||
test_cmp expect2 expect &&
|
test_cmp expect2 expect &&
|
||||||
rm expect expect2
|
rm expect expect2
|
||||||
)
|
)
|
||||||
@ -138,7 +138,7 @@ test_expect_success 'update git svn-cloned repo again (option ignore)' '
|
|||||||
cd c &&
|
cd c &&
|
||||||
git svn rebase --ignore-paths="^www" &&
|
git svn rebase --ignore-paths="^www" &&
|
||||||
printf "test_qqq\nb\nygg\n" > expect &&
|
printf "test_qqq\nb\nygg\n" > expect &&
|
||||||
for i in */*.txt; do cat $i >> expect2; done &&
|
for i in */*.txt; do cat $i >> expect2 || exit 1; done &&
|
||||||
test_cmp expect2 expect &&
|
test_cmp expect2 expect &&
|
||||||
rm expect expect2
|
rm expect expect2
|
||||||
)
|
)
|
||||||
|
@ -27,7 +27,7 @@ test_expect_success 'svn-authors setup' '
|
|||||||
test_expect_success 'setup svnrepo' '
|
test_expect_success 'setup svnrepo' '
|
||||||
for i in aa bb cc-sub dd-sub ee-foo ff
|
for i in aa bb cc-sub dd-sub ee-foo ff
|
||||||
do
|
do
|
||||||
svn mkdir -m $i --username $i "$svnrepo"/$i
|
svn mkdir -m $i --username $i "$svnrepo"/$i || return 1
|
||||||
done
|
done
|
||||||
'
|
'
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@ test_description='git svn creates empty directories'
|
|||||||
test_expect_success 'initialize repo' '
|
test_expect_success 'initialize repo' '
|
||||||
for i in a b c d d/e d/e/f "weird file name"
|
for i in a b c d d/e d/e/f "weird file name"
|
||||||
do
|
do
|
||||||
svn_cmd mkdir -m "mkdir $i" "$svnrepo"/"$i"
|
svn_cmd mkdir -m "mkdir $i" "$svnrepo"/"$i" || return 1
|
||||||
done
|
done
|
||||||
'
|
'
|
||||||
|
|
||||||
@ -102,7 +102,7 @@ test_expect_success 'git svn mkdirs -r works' '
|
|||||||
test_expect_success 'initialize trunk' '
|
test_expect_success 'initialize trunk' '
|
||||||
for i in trunk trunk/a trunk/"weird file name"
|
for i in trunk trunk/a trunk/"weird file name"
|
||||||
do
|
do
|
||||||
svn_cmd mkdir -m "mkdir $i" "$svnrepo"/"$i"
|
svn_cmd mkdir -m "mkdir $i" "$svnrepo"/"$i" || return 1
|
||||||
done
|
done
|
||||||
'
|
'
|
||||||
|
|
||||||
|
@ -28,7 +28,7 @@ test_expect_success 'setup test repository' '
|
|||||||
test_expect_success 'clone an SVN repository with filter to include qqq directory' '
|
test_expect_success 'clone an SVN repository with filter to include qqq directory' '
|
||||||
git svn clone --include-paths="qqq" "$svnrepo" g &&
|
git svn clone --include-paths="qqq" "$svnrepo" g &&
|
||||||
echo test_qqq > expect &&
|
echo test_qqq > expect &&
|
||||||
for i in g/*/*.txt; do cat $i >> expect2; done &&
|
for i in g/*/*.txt; do cat $i >> expect2 || return 1; done &&
|
||||||
test_cmp expect expect2
|
test_cmp expect expect2
|
||||||
'
|
'
|
||||||
|
|
||||||
@ -38,7 +38,7 @@ test_expect_success 'init+fetch an SVN repository with included qqq directory' '
|
|||||||
( cd c && git svn fetch --include-paths="qqq" ) &&
|
( cd c && git svn fetch --include-paths="qqq" ) &&
|
||||||
rm expect2 &&
|
rm expect2 &&
|
||||||
echo test_qqq > expect &&
|
echo test_qqq > expect &&
|
||||||
for i in c/*/*.txt; do cat $i >> expect2; done &&
|
for i in c/*/*.txt; do cat $i >> expect2 || return 1; done &&
|
||||||
test_cmp expect expect2
|
test_cmp expect expect2
|
||||||
'
|
'
|
||||||
|
|
||||||
@ -64,7 +64,7 @@ test_expect_success 'update git svn-cloned repo (config include)' '
|
|||||||
cd g &&
|
cd g &&
|
||||||
git svn rebase &&
|
git svn rebase &&
|
||||||
printf "test_qqq\nb\n" > expect &&
|
printf "test_qqq\nb\n" > expect &&
|
||||||
for i in */*.txt; do cat $i >> expect2; done &&
|
for i in */*.txt; do cat $i >> expect2 || exit 1; done &&
|
||||||
test_cmp expect2 expect &&
|
test_cmp expect2 expect &&
|
||||||
rm expect expect2
|
rm expect expect2
|
||||||
)
|
)
|
||||||
@ -75,7 +75,7 @@ test_expect_success 'update git svn-cloned repo (option include)' '
|
|||||||
cd c &&
|
cd c &&
|
||||||
git svn rebase --include-paths="qqq" &&
|
git svn rebase --include-paths="qqq" &&
|
||||||
printf "test_qqq\nb\n" > expect &&
|
printf "test_qqq\nb\n" > expect &&
|
||||||
for i in */*.txt; do cat $i >> expect2; done &&
|
for i in */*.txt; do cat $i >> expect2 || exit 1; done &&
|
||||||
test_cmp expect2 expect &&
|
test_cmp expect2 expect &&
|
||||||
rm expect expect2
|
rm expect expect2
|
||||||
)
|
)
|
||||||
@ -96,7 +96,7 @@ test_expect_success 'update git svn-cloned repo (config include)' '
|
|||||||
cd g &&
|
cd g &&
|
||||||
git svn rebase &&
|
git svn rebase &&
|
||||||
printf "test_qqq\nb\n" > expect &&
|
printf "test_qqq\nb\n" > expect &&
|
||||||
for i in */*.txt; do cat $i >> expect2; done &&
|
for i in */*.txt; do cat $i >> expect2 || exit 1; done &&
|
||||||
test_cmp expect2 expect &&
|
test_cmp expect2 expect &&
|
||||||
rm expect expect2
|
rm expect expect2
|
||||||
)
|
)
|
||||||
@ -107,7 +107,7 @@ test_expect_success 'update git svn-cloned repo (option include)' '
|
|||||||
cd c &&
|
cd c &&
|
||||||
git svn rebase --include-paths="qqq" &&
|
git svn rebase --include-paths="qqq" &&
|
||||||
printf "test_qqq\nb\n" > expect &&
|
printf "test_qqq\nb\n" > expect &&
|
||||||
for i in */*.txt; do cat $i >> expect2; done &&
|
for i in */*.txt; do cat $i >> expect2 || exit 1; done &&
|
||||||
test_cmp expect2 expect &&
|
test_cmp expect2 expect &&
|
||||||
rm expect expect2
|
rm expect expect2
|
||||||
)
|
)
|
||||||
@ -129,7 +129,7 @@ test_expect_success 'update git svn-cloned repo again (config include)' '
|
|||||||
cd g &&
|
cd g &&
|
||||||
git svn rebase &&
|
git svn rebase &&
|
||||||
printf "test_qqq\nb\nygg\n" > expect &&
|
printf "test_qqq\nb\nygg\n" > expect &&
|
||||||
for i in */*.txt; do cat $i >> expect2; done &&
|
for i in */*.txt; do cat $i >> expect2 || exit 1; done &&
|
||||||
test_cmp expect2 expect &&
|
test_cmp expect2 expect &&
|
||||||
rm expect expect2
|
rm expect expect2
|
||||||
)
|
)
|
||||||
@ -140,7 +140,7 @@ test_expect_success 'update git svn-cloned repo again (option include)' '
|
|||||||
cd c &&
|
cd c &&
|
||||||
git svn rebase --include-paths="qqq" &&
|
git svn rebase --include-paths="qqq" &&
|
||||||
printf "test_qqq\nb\nygg\n" > expect &&
|
printf "test_qqq\nb\nygg\n" > expect &&
|
||||||
for i in */*.txt; do cat $i >> expect2; done &&
|
for i in */*.txt; do cat $i >> expect2 || exit 1; done &&
|
||||||
test_cmp expect2 expect &&
|
test_cmp expect2 expect &&
|
||||||
rm expect expect2
|
rm expect expect2
|
||||||
)
|
)
|
||||||
|
@ -8,7 +8,7 @@ test_description='git svn creates empty directories, calls git gc, makes sure th
|
|||||||
test_expect_success 'initialize repo' '
|
test_expect_success 'initialize repo' '
|
||||||
for i in a b c d d/e d/e/f "weird file name"
|
for i in a b c d d/e d/e/f "weird file name"
|
||||||
do
|
do
|
||||||
svn_cmd mkdir -m "mkdir $i" "$svnrepo"/"$i"
|
svn_cmd mkdir -m "mkdir $i" "$svnrepo"/"$i" || return 1
|
||||||
done
|
done
|
||||||
'
|
'
|
||||||
|
|
||||||
|
@ -16,7 +16,7 @@ test_expect_success 'setup large marks file' '
|
|||||||
blob=$(git rev-parse HEAD:one.t) &&
|
blob=$(git rev-parse HEAD:one.t) &&
|
||||||
for i in $(test_seq 1024 16384)
|
for i in $(test_seq 1024 16384)
|
||||||
do
|
do
|
||||||
echo ":$i $blob"
|
echo ":$i $blob" || return 1
|
||||||
done >>marks
|
done >>marks
|
||||||
'
|
'
|
||||||
|
|
||||||
|
@ -338,7 +338,7 @@ test_expect_success 'cvs update (subdirectories)' \
|
|||||||
'(for dir in A A/B A/B/C A/D E; do
|
'(for dir in A A/B A/B/C A/D E; do
|
||||||
mkdir $dir &&
|
mkdir $dir &&
|
||||||
echo "test file in $dir" >"$dir/file_in_$(echo $dir|sed -e "s#/# #g")" &&
|
echo "test file in $dir" >"$dir/file_in_$(echo $dir|sed -e "s#/# #g")" &&
|
||||||
git add $dir
|
git add $dir || exit 1
|
||||||
done) &&
|
done) &&
|
||||||
git commit -q -m "deep sub directory structure" &&
|
git commit -q -m "deep sub directory structure" &&
|
||||||
git push gitcvs.git >/dev/null &&
|
git push gitcvs.git >/dev/null &&
|
||||||
@ -381,7 +381,7 @@ test_expect_success 'cvs update (merge)' \
|
|||||||
for i in 1 2 3 4 5 6 7
|
for i in 1 2 3 4 5 6 7
|
||||||
do
|
do
|
||||||
echo Line $i >>merge &&
|
echo Line $i >>merge &&
|
||||||
echo Line $i >>expected
|
echo Line $i >>expected || return 1
|
||||||
done &&
|
done &&
|
||||||
echo Line 8 >>expected &&
|
echo Line 8 >>expected &&
|
||||||
git add merge &&
|
git add merge &&
|
||||||
|
@ -171,7 +171,7 @@ test_expect_success 'clone using non-numeric revision ranges' '
|
|||||||
cd "$git" &&
|
cd "$git" &&
|
||||||
git ls-files >lines &&
|
git ls-files >lines &&
|
||||||
test_line_count = 8 lines
|
test_line_count = 8 lines
|
||||||
)
|
) || return 1
|
||||||
done
|
done
|
||||||
'
|
'
|
||||||
|
|
||||||
|
@ -92,11 +92,11 @@ test_expect_success 'Add some more files' '
|
|||||||
for i in $(test_seq 0 10)
|
for i in $(test_seq 0 10)
|
||||||
do
|
do
|
||||||
p4_add_file "included/x$i" &&
|
p4_add_file "included/x$i" &&
|
||||||
p4_add_file "excluded/x$i"
|
p4_add_file "excluded/x$i" || return 1
|
||||||
done &&
|
done &&
|
||||||
for i in $(test_seq 0 10)
|
for i in $(test_seq 0 10)
|
||||||
do
|
do
|
||||||
p4_add_file "excluded/y$i"
|
p4_add_file "excluded/y$i" || return 1
|
||||||
done
|
done
|
||||||
'
|
'
|
||||||
|
|
||||||
@ -123,7 +123,7 @@ test_expect_success 'Create a repo with multiple depot paths' '
|
|||||||
do
|
do
|
||||||
for i in $(test_seq 1 10)
|
for i in $(test_seq 1 10)
|
||||||
do
|
do
|
||||||
p4_add_file "$p/file$p$i"
|
p4_add_file "$p/file$p$i" || return 1
|
||||||
done
|
done
|
||||||
done
|
done
|
||||||
'
|
'
|
||||||
|
@ -879,7 +879,7 @@ test_expect_success '__git_refs - unique remote branches for git checkout DWIMer
|
|||||||
refs/remotes/remote/branch-in-remote
|
refs/remotes/remote/branch-in-remote
|
||||||
do
|
do
|
||||||
git update-ref $remote_ref main &&
|
git update-ref $remote_ref main &&
|
||||||
test_when_finished "git update-ref -d $remote_ref"
|
test_when_finished "git update-ref -d $remote_ref" || return 1
|
||||||
done &&
|
done &&
|
||||||
(
|
(
|
||||||
cur= &&
|
cur= &&
|
||||||
@ -1052,7 +1052,7 @@ test_expect_success '__git_refs - only matching refs - checkout DWIMery' '
|
|||||||
refs/remotes/remote/branch-in-remote
|
refs/remotes/remote/branch-in-remote
|
||||||
do
|
do
|
||||||
git update-ref $remote_ref main &&
|
git update-ref $remote_ref main &&
|
||||||
test_when_finished "git update-ref -d $remote_ref"
|
test_when_finished "git update-ref -d $remote_ref" || return 1
|
||||||
done &&
|
done &&
|
||||||
(
|
(
|
||||||
cur=mat &&
|
cur=mat &&
|
||||||
|
Loading…
Reference in New Issue
Block a user