test_expect_success "setup repo" '
if git rev-parse --verify refs/heads/p0006-ballast^{commit}
then
- echo Assuming synthetic repo from many-files.sh
- git branch br_base master
- git branch br_ballast p0006-ballast
- git config --local core.sparsecheckout 1
+ echo Assuming synthetic repo from many-files.sh &&
+ git branch br_base master &&
+ git branch br_ballast p0006-ballast &&
+ git config --local core.sparsecheckout 1 &&
cat >.git/info/sparse-checkout <<-EOF
/*
!ballast/*
EOF
else
- echo Assuming non-synthetic repo...
- git branch br_base $(git rev-list HEAD | tail -n 1)
+ echo Assuming non-synthetic repo... &&
+ git branch br_base $(git rev-list HEAD | tail -n 1) &&
git branch br_ballast HEAD
fi &&
git checkout -q br_ballast &&
test_expect_success "setup repo" '
if git rev-parse --verify refs/heads/p0006-ballast^{commit}
then
- echo Assuming synthetic repo from many-files.sh
- git branch br_base master
- git branch br_ballast p0006-ballast^
- git branch br_ballast_alias p0006-ballast^
- git branch br_ballast_plus_1 p0006-ballast
- git config --local core.sparsecheckout 1
+ echo Assuming synthetic repo from many-files.sh &&
+ git branch br_base master &&
+ git branch br_ballast p0006-ballast^ &&
+ git branch br_ballast_alias p0006-ballast^ &&
+ git branch br_ballast_plus_1 p0006-ballast &&
+ git config --local core.sparsecheckout 1 &&
cat >.git/info/sparse-checkout <<-EOF
/*
!ballast/*
EOF
else
- echo Assuming non-synthetic repo...
- git branch br_base $(git rev-list HEAD | tail -n 1)
- git branch br_ballast HEAD^ || error "no ancestor commit from current head"
- git branch br_ballast_alias HEAD^
+ echo Assuming non-synthetic repo... &&
+ git branch br_base $(git rev-list HEAD | tail -n 1) &&
+ git branch br_ballast HEAD^ || error "no ancestor commit from current head" &&
+ git branch br_ballast_alias HEAD^ &&
git branch br_ballast_plus_1 HEAD
fi &&
git checkout -q br_ballast &&
test_expect_success "setup repo" '
if git rev-parse --verify refs/heads/p0006-ballast^{commit}
then
- echo Assuming synthetic repo from many-files.sh
- git config --local core.sparsecheckout 1
+ echo Assuming synthetic repo from many-files.sh &&
+ git config --local core.sparsecheckout 1 &&
cat >.git/info/sparse-checkout <<-EOF
/*
!ballast/*
threads= &&
while test $t -gt 0
do
- threads="$t $threads"
+ threads="$t $threads" &&
t=$((t / 2))
done
'
# Measure pack loading with 10,000 packs.
test_expect_success 'generate lots of packs' '
for i in $(test_seq 10000); do
- echo "blob"
- echo "data <<EOF"
- echo "blob $i"
- echo "EOF"
+ echo "blob" &&
+ echo "data <<EOF" &&
+ echo "blob $i" &&
+ echo "EOF" &&
echo "checkpoint"
done |
git -c fastimport.unpackLimit=0 fast-import
bad= count=0 idx= &&
for p in .git/objects/pack/pack-*.pack
do
- count=$(( $count + 1 ))
+ count=$(( $count + 1 )) &&
if test_path_is_file "$p" &&
idx=${p%.pack}.idx && test_path_is_file "$idx"
then
bad= count=0 &&
for p in .git/objects/pack/pack-*.pack
do
- count=$(( $count + 1 ))
+ count=$(( $count + 1 )) &&
if test_path_is_file "$p" &&
idx=${p%.pack}.idx && test_path_is_file "$idx"
then
rm -f result &&
for i in 1 2 3 4
do
- git config --bool --get bool.true$i >>result
+ git config --bool --get bool.true$i >>result &&
git config --bool --get bool.false$i >>result
done &&
test_cmp expect result'
# NEEDSWORK: Stop hard-coding checksums.
if test "$indexversion" = "4"
then
- own=$(test_oid own_v4)
+ own=$(test_oid own_v4) &&
base=$(test_oid base_v4)
else
- own=$(test_oid own_v3)
+ own=$(test_oid own_v3) &&
base=$(test_oid base_v3)
fi &&
{
for path in path1 path2
do
- echo "100644 $one 1 $path"
- echo "100644 $two 2 $path"
+ echo "100644 $one 1 $path" &&
+ echo "100644 $two 2 $path" &&
echo "100644 $three 3 $path"
done
echo "100644 $one 1 path3"
file=$(cat .git/expected_test_file) &&
if should_create_test_file "$file"
then
- dirs=${file%/*}
+ dirs=${file%/*} &&
if test "$file" != "$dirs"
then
mkdir -p -- "$dirs" &&
test_expect_success 'git add with filemode=0, symlinks=0, and unmerged entries' '
for s in 1 2 3
do
- echo $s > stage$s
- echo "100755 $(git hash-object -w stage$s) $s file"
+ echo $s > stage$s &&
+ echo "100755 $(git hash-object -w stage$s) $s file" &&
echo "120000 $(printf $s | git hash-object -w -t blob --stdin) $s symlink"
done | git update-index --index-info &&
git config core.filemode 0 &&
for t in o x
do
path="$b$o$t" &&
- case "$path" in ooo) continue ;; esac
+ case "$path" in ooo) continue ;; esac &&
paths="$paths$path " &&
p=" $path" &&
case "$b" in x) echo "$m1$p" ;; esac &&
echo Oops, should not have succeeded
false
else
- status=$?
- echo "Status was $status"
+ status=$? &&
+ echo "Status was $status" &&
if test -f .git/index.lock
then
echo Oops, should not have crashed
x=1 &&
while test $x -lt $n
do
- printf "%63s%d\n" "" $x >>after
+ printf "%63s%d\n" "" $x >>after &&
x=$(( $x + 1 ))
done &&
printf "\t%s\n" d e f >>after &&
x=1 &&
while test $x -lt $n
do
- printf "%63s%d\n" "" $x >>expect-2
+ printf "%63s%d\n" "" $x >>expect-2 &&
x=$(( $x + 1 ))
done &&
printf "%64s\n" d e f >>expect-2 &&
x=0 &&
while test $x -lt $n
do
- printf "%63s%02d\n" "" $x >>after
+ printf "%63s%02d\n" "" $x >>after &&
x=$(( $x + 1 ))
done &&
printf "\t%s\n" d e f >>after &&
x=0 &&
while test $x -lt $n
do
- printf "%63s%02d\n" "" $x >>expect-3
+ printf "%63s%02d\n" "" $x >>expect-3 &&
x=$(( $x + 1 ))
done &&
printf "%64s\n" d e f >>expect-3 &&
x=0 &&
while test $x -lt 50
do
- printf "\t%02d\n" $x >>before
+ printf "\t%02d\n" $x >>before &&
x=$(( $x + 1 ))
done &&
cat before >after &&
printf "%64s\n" a b c >>after &&
while test $x -lt 100
do
- printf "\t%02d\n" $x >>before
- printf "\t%02d\n" $x >>after
+ printf "\t%02d\n" $x >>before &&
+ printf "\t%02d\n" $x >>after &&
x=$(( $x + 1 ))
done &&
test_expect_code 1 git diff --no-index before after >patch4.patch.raw &&
x=0 &&
while test $x -lt 50
do
- printf "%63s%02d\n" "" $x >>test-4
+ printf "%63s%02d\n" "" $x >>test-4 &&
x=$(( $x + 1 ))
done &&
cat test-4 >expect-4 &&
printf "%64s\n" a b c >>expect-4 &&
while test $x -lt 100
do
- printf "%63s%02d\n" "" $x >>test-4
- printf "%63s%02d\n" "" $x >>expect-4
+ printf "%63s%02d\n" "" $x >>test-4 &&
+ printf "%63s%02d\n" "" $x >>expect-4 &&
x=$(( $x + 1 ))
done &&
i=1 &&
while test $i -le 100
do
- iii=$(printf "%03i" $i)
+ iii=$(printf "%03i" $i) &&
test-tool genrandom "bar" 200 > wide_delta_$iii &&
test-tool genrandom "baz $iii" 50 >> wide_delta_$iii &&
test-tool genrandom "foo"$i 100 > deep_delta_$iii &&
git init r1 &&
for n in 1 2 3 4 5
do
- echo "This is file: $n" > r1/file.$n
- git -C r1 add file.$n
+ echo "This is file: $n" > r1/file.$n &&
+ git -C r1 add file.$n &&
git -C r1 commit -m "$n"
done
'
git init r2 &&
for n in 1000 10000
do
- printf "%"$n"s" X > r2/large.$n
- git -C r2 add large.$n
+ printf "%"$n"s" X > r2/large.$n &&
+ git -C r2 add large.$n &&
git -C r2 commit -m "$n"
done
'
mkdir r3/dir1 &&
for n in sparse1 sparse2
do
- echo "This is file: $n" > r3/$n
- git -C r3 add $n
- echo "This is file: dir1/$n" > r3/dir1/$n
+ echo "This is file: $n" > r3/$n &&
+ git -C r3 add $n &&
+ echo "This is file: dir1/$n" > r3/dir1/$n &&
git -C r3 add dir1/$n
done &&
git -C r3 commit -m "sparse" &&
mkdir r4/dir1 &&
for n in sparse1 sparse2
do
- echo "This is file: $n" > r4/$n
- git -C r4 add $n
- echo "This is file: dir1/$n" > r4/dir1/$n
+ echo "This is file: $n" > r4/$n &&
+ git -C r4 add $n &&
+ echo "This is file: dir1/$n" > r4/dir1/$n &&
git -C r4 add dir1/$n
done &&
echo dir1/ >r4/pattern &&
nr=1000
while test $nr -lt 2000
do
- nr=$(( $nr + 1 ))
+ nr=$(( $nr + 1 )) &&
echo "create refs/heads/b/$nr $COMMIT3"
done
} | git update-ref --stdin
git init src &&
for n in 1 2 3 4
do
- echo "This is file: $n" > src/file.$n.txt
- git -C src add file.$n.txt
- git -C src commit -m "file $n"
+ echo "This is file: $n" > src/file.$n.txt &&
+ git -C src add file.$n.txt &&
+ git -C src commit -m "file $n" &&
git -C src ls-files -s file.$n.txt >>temp
done &&
awk -f print_2.awk <temp | sort >expect_1.oids &&
git -C src remote add srv "file://$(pwd)/srv.bare" &&
for x in a b c d e
do
- echo "Mod file.1.txt $x" >>src/file.1.txt
- git -C src add file.1.txt
+ echo "Mod file.1.txt $x" >>src/file.1.txt &&
+ git -C src add file.1.txt &&
git -C src commit -m "mod $x"
done &&
git -C src blame main -- file.1.txt >expect.blame &&
test_expect_success 'push new commits to server for file.2.txt' '
for x in a b c d e f
do
- echo "Mod file.2.txt $x" >>src/file.2.txt
- git -C src add file.2.txt
+ echo "Mod file.2.txt $x" >>src/file.2.txt &&
+ git -C src add file.2.txt &&
git -C src commit -m "mod $x"
done &&
git -C src push -u srv main
test_expect_success 'push new commits to server for file.3.txt' '
for x in a b c d e f
do
- echo "Mod file.3.txt $x" >>src/file.3.txt
- git -C src add file.3.txt
+ echo "Mod file.3.txt $x" >>src/file.3.txt &&
+ git -C src add file.3.txt &&
git -C src commit -m "mod $x"
done &&
git -C src push -u srv main
. ./test-lib.sh
test_expect_success 'setup' '
- for n in 1 2 3 4 5 ; do \
- echo $n > a ; \
- git add a ; \
- git commit -m "$n" ; \
+ for n in 1 2 3 4 5 ; do
+ echo $n > a &&
+ git add a &&
+ git commit -m "$n"
done
'
test_tick_keep=$test_tick &&
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
done &&
git rev-list t1^! --not t$i >result &&
git init r1 &&
for n in 1 2 3 4 5
do
- echo "This is file: $n" > r1/file.$n
- git -C r1 add file.$n
+ echo "This is file: $n" > r1/file.$n &&
+ git -C r1 add file.$n &&
git -C r1 commit -m "$n"
done
'
git init r2 &&
for n in 1000 10000
do
- printf "%"$n"s" X > r2/large.$n
- git -C r2 add large.$n
+ printf "%"$n"s" X > r2/large.$n &&
+ git -C r2 add large.$n &&
git -C r2 commit -m "$n"
done
'
mkdir r3/dir1 &&
for n in sparse1 sparse2
do
- echo "This is file: $n" > r3/$n
- git -C r3 add $n
- echo "This is file: dir1/$n" > r3/dir1/$n
+ echo "This is file: $n" > r3/$n &&
+ git -C r3 add $n &&
+ echo "This is file: dir1/$n" > r3/dir1/$n &&
git -C r3 add dir1/$n
done &&
git -C r3 commit -m "sparse" &&
committer A U Thor <author@example.com> $((1000000000 + $i * 100)) +0200
data <<EOF
commit #$i
-EOF"
- test $i = 1 && echo "from refs/heads/main^0"
+EOF" &&
+ if test $i = 1
+ then
+ echo "from refs/heads/main^0"
+ fi &&
i=$(($i + 1))
done | git fast-import &&
git checkout main &&
echo Oops, should not have succeeded
false
else
- git ls-files -s >current
+ git ls-files -s >current &&
test_cmp expect current
fi
'
echo Oops, should not have succeeded
false
else
- git ls-files -s >current
+ git ls-files -s >current &&
test_cmp expect current
fi
'
git commit -a -m change=$n &&
git checkout -b test$n HEAD^ &&
for i in $(count $n); do
- git rm $i
+ git rm $i &&
make_text $i initial changed >$i.moved
done &&
git add . &&
committer A U Thor <author@example.com> $((1000000000 + $i * 100)) +0200
data <<EOF
commit #$i
-EOF"
- test $i = 1 && echo "from refs/heads/main^0"
+EOF" &&
+ if test $i = 1
+ then
+ echo "from refs/heads/main^0"
+ fi &&
i=$(($i + 1))
done | git fast-import &&
git checkout main &&
git config core.preloadIndex $preload_val &&
if test $preload_val = true
then
- GIT_TEST_PRELOAD_INDEX=$preload_val; export GIT_TEST_PRELOAD_INDEX
+ GIT_TEST_PRELOAD_INDEX=$preload_val && export GIT_TEST_PRELOAD_INDEX
else
sane_unset GIT_TEST_PRELOAD_INDEX
fi
refs="" &&
while test $i -le 30
do
- refs="$refs c$i"
+ refs="$refs c$i" &&
i=$(expr $i + 1)
done &&
git merge $refs &&
git svn clone --authors-file=svn-authors -s "$svnrepo"/aa aa-work &&
for i in bb ee cc
do
- branch="aa/branches/$i"
+ branch="aa/branches/$i" &&
svn_cmd mkdir -m "$branch" --username $i "$svnrepo/$branch"
done
'