Skip to content

Instantly share code, notes, and snippets.

@rfjakob
Created June 15, 2025 10:56
Show Gist options
  • Save rfjakob/dc88f22622d82a0c9b8fb18ef787bfac to your computer and use it in GitHub Desktop.
Save rfjakob/dc88f22622d82a0c9b8fb18ef787bfac to your computer and use it in GitHub Desktop.
./t9300-fast-import.sh -v -x
0 jakob@brikett:/var/tmp/b/git/t$ ./t9300-fast-import.sh -v -x
Initialized empty Git repository in /var/tmp/b/git/t/trash directory.t9300-fast-import/.git/
expecting success of 9300.1 'empty stream succeeds':
git config fastimport.unpackLimit 0 &&
git fast-import </dev/null
++ git config fastimport.unpackLimit 0
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 0 ( 0 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 0 ( 0 duplicates 0 deltas of 0 attempts)
commits: 0 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 0 ( 0 loads )
marks: 1024 ( 0 unique )
atoms: 0
Memory total: 2399 KiB
pools: 2048 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 0
pack_report: core.packedGitLimit = 0
pack_report: pack_used_ctr = 0
pack_report: pack_mmap_calls = 0
pack_report: pack_open_windows = 0 / 0
pack_report: pack_mapped = 0 / 0
---------------------------------------------------------------------
ok 1 - empty stream succeeds
expecting success of 9300.2 'truncated stream complains':
echo "tag foo" | test_must_fail git fast-import
++ echo 'tag foo'
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
fatal: Expected from command, got
fast-import: dumping crash report to .git/fast_import_crash_1943299
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
ok 2 - truncated stream complains
expecting success of 9300.3 'A: create pack from stdin':
test_tick &&
cat >input <<-INPUT_END &&
blob
mark :2
data <<EOF
$file2_data
EOF
blob
mark :3
data <<END
$file3_data
END
blob
mark :4
data $file4_len
$file4_data
commit refs/heads/main
mark :5
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
initial
COMMIT
M 644 :2 file2
M 644 :3 file3
M 755 :4 file4
tag series-A
from :5
data <<EOF
An annotated tag without a tagger
EOF
tag series-A-blob
from :3
data <<EOF
An annotated tag that annotates a blob.
EOF
tag to-be-deleted
from :3
data <<EOF
Another annotated tag that annotates a blob.
EOF
reset refs/tags/to-be-deleted
from $ZERO_OID
tag nested
mark :6
from :4
data <<EOF
Tag of our lovely commit
EOF
reset refs/tags/nested
from $ZERO_OID
tag nested
mark :7
from :6
data <<EOF
Tag of tag of our lovely commit
EOF
alias
mark :8
to :5
INPUT_END
git fast-import --export-marks=marks.out <input &&
git whatchanged main
++ test_tick
++ test -z ''
++ test_tick=1112911993
++ GIT_COMMITTER_DATE='1112911993 -0700'
++ GIT_AUTHOR_DATE='1112911993 -0700'
++ export GIT_COMMITTER_DATE GIT_AUTHOR_DATE
++ cat
++ git fast-import --export-marks=marks.out
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 10 ( 0 duplicates )
blobs : 3 ( 0 duplicates 0 deltas of 1 attempts)
trees : 1 ( 0 duplicates 0 deltas of 0 attempts)
commits: 1 ( 0 duplicates 0 deltas of 0 attempts)
tags : 5 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 3 ( 1 loads )
marks: 1024 ( 7 unique )
atoms: 3
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 9
pack_report: pack_mmap_calls = 2
pack_report: pack_open_windows = 1 / 1
pack_report: pack_mapped = 848 / 848
---------------------------------------------------------------------
++ git whatchanged main
commit 5ba2d0485e3e071f4ccbfdb22c474b305ebd159c (HEAD -> main, tag: series-A)
Author: C O Mitter <[email protected]>
Date: Thu Apr 7 15:13:13 2005 -0700
initial
:000000 100644 0000000 7123f7f A file2
:000000 100644 0000000 0d92e9f A file3
:000000 100755 0000000 85df507 A file4
ok 3 - A: create pack from stdin
expecting success of 9300.4 'A: verify pack':
verify_packs
++ verify_packs
++ for p in .git/objects/pack/*.pack
++ git verify-pack .git/objects/pack/pack-50f21168a486ab43c73c3873f438e534658e36dd.pack
ok 4 - A: verify pack
expecting success of 9300.5 'A: verify commit':
cat >expect <<-EOF &&
author $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
initial
EOF
git cat-file commit main | sed 1d >actual &&
test_cmp expect actual
++ cat
++ git cat-file commit main
++ sed 1d
++ test_cmp expect actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual
ok 5 - A: verify commit
expecting success of 9300.6 'A: verify tree':
cat >expect <<-EOF &&
100644 blob file2
100644 blob file3
100755 blob file4
EOF
git cat-file -p main^{tree} | sed "s/ [0-9a-f]* / /" >actual &&
test_cmp expect actual
++ cat
++ git cat-file -p 'main^{tree}'
++ sed 's/ [0-9a-f]* / /'
++ test_cmp expect actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual
ok 6 - A: verify tree
expecting success of 9300.7 'A: verify file2':
echo "$file2_data" >expect &&
git cat-file blob main:file2 >actual &&
test_cmp expect actual
++ echo 'file2
second line of EOF'
++ git cat-file blob main:file2
++ test_cmp expect actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual
ok 7 - A: verify file2
expecting success of 9300.8 'A: verify file3':
echo "$file3_data" >expect &&
git cat-file blob main:file3 >actual &&
test_cmp expect actual
++ echo 'EOF
in 3rd file
END'
++ git cat-file blob main:file3
++ test_cmp expect actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual
ok 8 - A: verify file3
expecting success of 9300.9 'A: verify file4':
printf "$file4_data" >expect &&
git cat-file blob main:file4 >actual &&
test_cmp expect actual
++ printf abcd
++ git cat-file blob main:file4
++ test_cmp expect actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual
ok 9 - A: verify file4
expecting success of 9300.10 'A: verify tag/series-A':
cat >expect <<-EOF &&
object $(git rev-parse refs/heads/main)
type commit
tag series-A
An annotated tag without a tagger
EOF
git cat-file tag tags/series-A >actual &&
test_cmp expect actual
++ cat
+++ git rev-parse refs/heads/main
++ git cat-file tag tags/series-A
++ test_cmp expect actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual
ok 10 - A: verify tag/series-A
expecting success of 9300.11 'A: verify tag/series-A-blob':
cat >expect <<-EOF &&
object $(git rev-parse refs/heads/main:file3)
type blob
tag series-A-blob
An annotated tag that annotates a blob.
EOF
git cat-file tag tags/series-A-blob >actual &&
test_cmp expect actual
++ cat
+++ git rev-parse refs/heads/main:file3
++ git cat-file tag tags/series-A-blob
++ test_cmp expect actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual
ok 11 - A: verify tag/series-A-blob
expecting success of 9300.12 'A: verify tag deletion is successful':
test_must_fail git rev-parse --verify refs/tags/to-be-deleted
++ test_must_fail git rev-parse --verify refs/tags/to-be-deleted
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git rev-parse --verify refs/tags/to-be-deleted
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git rev-parse --verify refs/tags/to-be-deleted
fatal: Needed a single revision
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
ok 12 - A: verify tag deletion is successful
expecting success of 9300.13 'A: verify marks output':
cat >expect <<-EOF &&
:2 $(git rev-parse --verify main:file2)
:3 $(git rev-parse --verify main:file3)
:4 $(git rev-parse --verify main:file4)
:5 $(git rev-parse --verify main^0)
:6 $(git cat-file tag nested | grep object | cut -d" " -f 2)
:7 $(git rev-parse --verify nested)
:8 $(git rev-parse --verify main^0)
EOF
test_cmp expect marks.out
++ cat
+++ git rev-parse --verify main:file2
+++ git rev-parse --verify main:file3
+++ git rev-parse --verify main:file4
+++ git rev-parse --verify 'main^0'
+++ git cat-file tag nested
+++ grep object
+++ cut '-d ' -f 2
+++ git rev-parse --verify nested
+++ git rev-parse --verify 'main^0'
++ test_cmp expect marks.out
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect marks.out
ok 13 - A: verify marks output
expecting success of 9300.14 'A: verify marks import':
git fast-import \
--import-marks=marks.out \
--export-marks=marks.new \
</dev/null &&
test_cmp expect marks.new
++ git fast-import --import-marks=marks.out --export-marks=marks.new
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 0 ( 0 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 0 ( 0 duplicates 0 deltas of 0 attempts)
commits: 0 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 0 ( 0 loads )
marks: 1024 ( 7 unique )
atoms: 0
Memory total: 2399 KiB
pools: 2048 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 6
pack_report: pack_mmap_calls = 1
pack_report: pack_open_windows = 1 / 1
pack_report: pack_mapped = 848 / 848
---------------------------------------------------------------------
++ test_cmp expect marks.new
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect marks.new
ok 14 - A: verify marks import
expecting success of 9300.15 'A: tag blob by sha1':
test_tick &&
new_blob=$(echo testing | git hash-object --stdin) &&
cat >input <<-INPUT_END &&
tag series-A-blob-2
from $(git rev-parse refs/heads/main:file3)
data <<EOF
Tag blob by sha1.
EOF
blob
mark :6
data <<EOF
testing
EOF
commit refs/heads/new_blob
committer <> 0 +0000
data 0
M 644 :6 new_blob
#pretend we got sha1 from fast-import
ls "new_blob"
tag series-A-blob-3
from $new_blob
data <<EOF
Tag new_blob.
EOF
INPUT_END
cat >expect <<-EOF &&
object $(git rev-parse refs/heads/main:file3)
type blob
tag series-A-blob-2
Tag blob by sha1.
object $new_blob
type blob
tag series-A-blob-3
Tag new_blob.
EOF
git fast-import <input &&
git cat-file tag tags/series-A-blob-2 >actual &&
git cat-file tag tags/series-A-blob-3 >>actual &&
test_cmp expect actual
++ test_tick
++ test -z set
++ test_tick=1112912053
++ GIT_COMMITTER_DATE='1112912053 -0700'
++ GIT_AUTHOR_DATE='1112912053 -0700'
++ export GIT_COMMITTER_DATE GIT_AUTHOR_DATE
+++ echo testing
+++ git hash-object --stdin
++ new_blob=038d718da6a1ebbc6a7780a96ed75a70cc2ad6e2
++ cat
+++ git rev-parse refs/heads/main:file3
++ cat
+++ git rev-parse refs/heads/main:file3
++ git fast-import
100644 blob 038d718da6a1ebbc6a7780a96ed75a70cc2ad6e2 new_blob
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 5 ( 0 duplicates )
blobs : 1 ( 0 duplicates 0 deltas of 0 attempts)
trees : 1 ( 0 duplicates 0 deltas of 0 attempts)
commits: 1 ( 0 duplicates 0 deltas of 0 attempts)
tags : 2 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 1 unique )
atoms: 1
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 7
pack_report: pack_mmap_calls = 2
pack_report: pack_open_windows = 2 / 2
pack_report: pack_mapped = 1217 / 1217
---------------------------------------------------------------------
++ git cat-file tag tags/series-A-blob-2
++ git cat-file tag tags/series-A-blob-3
++ test_cmp expect actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual
ok 15 - A: tag blob by sha1
expecting success of 9300.16 'A: verify marks import does not crash':
test_tick &&
cat >input <<-INPUT_END &&
commit refs/heads/verify--import-marks
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
recreate from :5
COMMIT
from :5
M 755 :2 copy-of-file2
INPUT_END
git fast-import --import-marks=marks.out <input &&
git whatchanged verify--import-marks
++ test_tick
++ test -z set
++ test_tick=1112912113
++ GIT_COMMITTER_DATE='1112912113 -0700'
++ GIT_AUTHOR_DATE='1112912113 -0700'
++ export GIT_COMMITTER_DATE GIT_AUTHOR_DATE
++ cat
++ git fast-import --import-marks=marks.out
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 2 ( 0 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 1 ( 0 duplicates 0 deltas of 0 attempts)
commits: 1 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 7 unique )
atoms: 4
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 10
pack_report: pack_mmap_calls = 2
pack_report: pack_open_windows = 2 / 2
pack_report: pack_mapped = 1147 / 1147
---------------------------------------------------------------------
++ git whatchanged verify--import-marks
commit ac2b62088fe0283163c00fa7856bcd0489cf30de (verify--import-marks)
Author: C O Mitter <[email protected]>
Date: Thu Apr 7 15:15:13 2005 -0700
recreate from :5
:000000 100755 0000000 7123f7f A copy-of-file2
commit 5ba2d0485e3e071f4ccbfdb22c474b305ebd159c (HEAD -> main, tag: series-A)
Author: C O Mitter <[email protected]>
Date: Thu Apr 7 15:13:13 2005 -0700
initial
:000000 100644 0000000 7123f7f A file2
:000000 100644 0000000 0d92e9f A file3
:000000 100755 0000000 85df507 A file4
ok 16 - A: verify marks import does not crash
expecting success of 9300.17 'A: verify pack':
verify_packs
++ verify_packs
++ for p in .git/objects/pack/*.pack
++ git verify-pack .git/objects/pack/pack-50f21168a486ab43c73c3873f438e534658e36dd.pack
++ for p in .git/objects/pack/*.pack
++ git verify-pack .git/objects/pack/pack-555f6fd0ab94999b7b8e96d0a665309a043d1066.pack
++ for p in .git/objects/pack/*.pack
++ git verify-pack .git/objects/pack/pack-7aa6db06b46a08200d90b91ace62a65184e44f04.pack
ok 17 - A: verify pack
expecting success of 9300.18 'A: verify diff':
copy=$(git rev-parse --verify main:file2) &&
cat >expect <<-EOF &&
:000000 100755 $ZERO_OID $copy A copy-of-file2
EOF
git diff-tree -M -r main verify--import-marks >actual &&
compare_diff_raw expect actual &&
test $(git rev-parse --verify main:file2) \
= $(git rev-parse --verify verify--import-marks:copy-of-file2)
+++ git rev-parse --verify main:file2
++ copy=7123f7f44e39be127c5eb701e5968176ee9d78b1
++ cat
++ git diff-tree -M -r main verify--import-marks
++ compare_diff_raw expect actual
++ sed -e '/^:/s/ \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([A-Z]\)[0-9]* / \1 \2 \3# /'
++ sed -e '/^:/s/ \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([A-Z]\)[0-9]* / \1 \2 \3# /'
++ test_cmp .tmp-1 .tmp-2
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u .tmp-1 .tmp-2
++ rm -f .tmp-1 .tmp-2
+++ git rev-parse --verify main:file2
+++ git rev-parse --verify verify--import-marks:copy-of-file2
++ test 7123f7f44e39be127c5eb701e5968176ee9d78b1 = 7123f7f44e39be127c5eb701e5968176ee9d78b1
ok 18 - A: verify diff
expecting success of 9300.19 'A: export marks with large values':
test_tick &&
mt=$(git hash-object --stdin < /dev/null) &&
>input.blob &&
>marks.exp &&
>tree.exp &&
cat >input.commit <<-EOF &&
commit refs/heads/verify--dump-marks
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
test the sparse array dumping routines with exponentially growing marks
COMMIT
EOF
i=0 l=4 m=6 n=7 &&
while test "$i" -lt 27
do
cat >>input.blob <<-EOF &&
blob
mark :$l
data 0
blob
mark :$m
data 0
blob
mark :$n
data 0
EOF
echo "M 100644 :$l l$i" >>input.commit &&
echo "M 100644 :$m m$i" >>input.commit &&
echo "M 100644 :$n n$i" >>input.commit &&
echo ":$l $mt" >>marks.exp &&
echo ":$m $mt" >>marks.exp &&
echo ":$n $mt" >>marks.exp &&
printf "100644 blob $mt\tl$i\n" >>tree.exp &&
printf "100644 blob $mt\tm$i\n" >>tree.exp &&
printf "100644 blob $mt\tn$i\n" >>tree.exp &&
l=$(($l + $l)) &&
m=$(($m + $m)) &&
n=$(($l + $n)) &&
i=$((1 + $i)) || return 1
done &&
sort tree.exp > tree.exp_s &&
cat input.blob input.commit | git fast-import --export-marks=marks.large &&
git ls-tree refs/heads/verify--dump-marks >tree.out &&
test_cmp tree.exp_s tree.out &&
test_cmp marks.exp marks.large
++ test_tick
++ test -z set
++ test_tick=1112912173
++ GIT_COMMITTER_DATE='1112912173 -0700'
++ GIT_AUTHOR_DATE='1112912173 -0700'
++ export GIT_COMMITTER_DATE GIT_AUTHOR_DATE
+++ git hash-object --stdin
++ mt=e69de29bb2d1d6434b8b29ae775ad8c2e48c5391
++ cat
++ i=0
++ l=4
++ m=6
++ n=7
++ test 0 -lt 27
++ cat
++ echo 'M 100644 :4 l0'
++ echo 'M 100644 :6 m0'
++ echo 'M 100644 :7 n0'
++ echo ':4 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':6 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':7 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tl0\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tm0\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tn0\n'
++ l=8
++ m=12
++ n=15
++ i=1
++ test 1 -lt 27
++ cat
++ echo 'M 100644 :8 l1'
++ echo 'M 100644 :12 m1'
++ echo 'M 100644 :15 n1'
++ echo ':8 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':12 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':15 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tl1\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tm1\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tn1\n'
++ l=16
++ m=24
++ n=31
++ i=2
++ test 2 -lt 27
++ cat
++ echo 'M 100644 :16 l2'
++ echo 'M 100644 :24 m2'
++ echo 'M 100644 :31 n2'
++ echo ':16 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':24 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':31 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tl2\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tm2\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tn2\n'
++ l=32
++ m=48
++ n=63
++ i=3
++ test 3 -lt 27
++ cat
++ echo 'M 100644 :32 l3'
++ echo 'M 100644 :48 m3'
++ echo 'M 100644 :63 n3'
++ echo ':32 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':48 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':63 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tl3\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tm3\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tn3\n'
++ l=64
++ m=96
++ n=127
++ i=4
++ test 4 -lt 27
++ cat
++ echo 'M 100644 :64 l4'
++ echo 'M 100644 :96 m4'
++ echo 'M 100644 :127 n4'
++ echo ':64 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':96 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':127 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tl4\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tm4\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tn4\n'
++ l=128
++ m=192
++ n=255
++ i=5
++ test 5 -lt 27
++ cat
++ echo 'M 100644 :128 l5'
++ echo 'M 100644 :192 m5'
++ echo 'M 100644 :255 n5'
++ echo ':128 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':192 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':255 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tl5\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tm5\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tn5\n'
++ l=256
++ m=384
++ n=511
++ i=6
++ test 6 -lt 27
++ cat
++ echo 'M 100644 :256 l6'
++ echo 'M 100644 :384 m6'
++ echo 'M 100644 :511 n6'
++ echo ':256 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':384 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':511 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tl6\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tm6\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tn6\n'
++ l=512
++ m=768
++ n=1023
++ i=7
++ test 7 -lt 27
++ cat
++ echo 'M 100644 :512 l7'
++ echo 'M 100644 :768 m7'
++ echo 'M 100644 :1023 n7'
++ echo ':512 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':768 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':1023 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tl7\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tm7\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tn7\n'
++ l=1024
++ m=1536
++ n=2047
++ i=8
++ test 8 -lt 27
++ cat
++ echo 'M 100644 :1024 l8'
++ echo 'M 100644 :1536 m8'
++ echo 'M 100644 :2047 n8'
++ echo ':1024 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':1536 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':2047 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tl8\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tm8\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tn8\n'
++ l=2048
++ m=3072
++ n=4095
++ i=9
++ test 9 -lt 27
++ cat
++ echo 'M 100644 :2048 l9'
++ echo 'M 100644 :3072 m9'
++ echo 'M 100644 :4095 n9'
++ echo ':2048 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':3072 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':4095 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tl9\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tm9\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tn9\n'
++ l=4096
++ m=6144
++ n=8191
++ i=10
++ test 10 -lt 27
++ cat
++ echo 'M 100644 :4096 l10'
++ echo 'M 100644 :6144 m10'
++ echo 'M 100644 :8191 n10'
++ echo ':4096 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':6144 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':8191 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tl10\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tm10\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tn10\n'
++ l=8192
++ m=12288
++ n=16383
++ i=11
++ test 11 -lt 27
++ cat
++ echo 'M 100644 :8192 l11'
++ echo 'M 100644 :12288 m11'
++ echo 'M 100644 :16383 n11'
++ echo ':8192 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':12288 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':16383 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tl11\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tm11\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tn11\n'
++ l=16384
++ m=24576
++ n=32767
++ i=12
++ test 12 -lt 27
++ cat
++ echo 'M 100644 :16384 l12'
++ echo 'M 100644 :24576 m12'
++ echo 'M 100644 :32767 n12'
++ echo ':16384 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':24576 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':32767 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tl12\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tm12\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tn12\n'
++ l=32768
++ m=49152
++ n=65535
++ i=13
++ test 13 -lt 27
++ cat
++ echo 'M 100644 :32768 l13'
++ echo 'M 100644 :49152 m13'
++ echo 'M 100644 :65535 n13'
++ echo ':32768 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':49152 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':65535 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tl13\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tm13\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tn13\n'
++ l=65536
++ m=98304
++ n=131071
++ i=14
++ test 14 -lt 27
++ cat
++ echo 'M 100644 :65536 l14'
++ echo 'M 100644 :98304 m14'
++ echo 'M 100644 :131071 n14'
++ echo ':65536 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':98304 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':131071 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tl14\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tm14\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tn14\n'
++ l=131072
++ m=196608
++ n=262143
++ i=15
++ test 15 -lt 27
++ cat
++ echo 'M 100644 :131072 l15'
++ echo 'M 100644 :196608 m15'
++ echo 'M 100644 :262143 n15'
++ echo ':131072 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':196608 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':262143 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tl15\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tm15\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tn15\n'
++ l=262144
++ m=393216
++ n=524287
++ i=16
++ test 16 -lt 27
++ cat
++ echo 'M 100644 :262144 l16'
++ echo 'M 100644 :393216 m16'
++ echo 'M 100644 :524287 n16'
++ echo ':262144 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':393216 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':524287 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tl16\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tm16\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tn16\n'
++ l=524288
++ m=786432
++ n=1048575
++ i=17
++ test 17 -lt 27
++ cat
++ echo 'M 100644 :524288 l17'
++ echo 'M 100644 :786432 m17'
++ echo 'M 100644 :1048575 n17'
++ echo ':524288 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':786432 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':1048575 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tl17\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tm17\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tn17\n'
++ l=1048576
++ m=1572864
++ n=2097151
++ i=18
++ test 18 -lt 27
++ cat
++ echo 'M 100644 :1048576 l18'
++ echo 'M 100644 :1572864 m18'
++ echo 'M 100644 :2097151 n18'
++ echo ':1048576 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':1572864 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':2097151 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tl18\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tm18\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tn18\n'
++ l=2097152
++ m=3145728
++ n=4194303
++ i=19
++ test 19 -lt 27
++ cat
++ echo 'M 100644 :2097152 l19'
++ echo 'M 100644 :3145728 m19'
++ echo 'M 100644 :4194303 n19'
++ echo ':2097152 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':3145728 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':4194303 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tl19\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tm19\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tn19\n'
++ l=4194304
++ m=6291456
++ n=8388607
++ i=20
++ test 20 -lt 27
++ cat
++ echo 'M 100644 :4194304 l20'
++ echo 'M 100644 :6291456 m20'
++ echo 'M 100644 :8388607 n20'
++ echo ':4194304 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':6291456 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':8388607 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tl20\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tm20\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tn20\n'
++ l=8388608
++ m=12582912
++ n=16777215
++ i=21
++ test 21 -lt 27
++ cat
++ echo 'M 100644 :8388608 l21'
++ echo 'M 100644 :12582912 m21'
++ echo 'M 100644 :16777215 n21'
++ echo ':8388608 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':12582912 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':16777215 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tl21\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tm21\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tn21\n'
++ l=16777216
++ m=25165824
++ n=33554431
++ i=22
++ test 22 -lt 27
++ cat
++ echo 'M 100644 :16777216 l22'
++ echo 'M 100644 :25165824 m22'
++ echo 'M 100644 :33554431 n22'
++ echo ':16777216 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':25165824 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':33554431 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tl22\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tm22\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tn22\n'
++ l=33554432
++ m=50331648
++ n=67108863
++ i=23
++ test 23 -lt 27
++ cat
++ echo 'M 100644 :33554432 l23'
++ echo 'M 100644 :50331648 m23'
++ echo 'M 100644 :67108863 n23'
++ echo ':33554432 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':50331648 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':67108863 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tl23\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tm23\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tn23\n'
++ l=67108864
++ m=100663296
++ n=134217727
++ i=24
++ test 24 -lt 27
++ cat
++ echo 'M 100644 :67108864 l24'
++ echo 'M 100644 :100663296 m24'
++ echo 'M 100644 :134217727 n24'
++ echo ':67108864 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':100663296 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':134217727 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tl24\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tm24\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tn24\n'
++ l=134217728
++ m=201326592
++ n=268435455
++ i=25
++ test 25 -lt 27
++ cat
++ echo 'M 100644 :134217728 l25'
++ echo 'M 100644 :201326592 m25'
++ echo 'M 100644 :268435455 n25'
++ echo ':134217728 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':201326592 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':268435455 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tl25\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tm25\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tn25\n'
++ l=268435456
++ m=402653184
++ n=536870911
++ i=26
++ test 26 -lt 27
++ cat
++ echo 'M 100644 :268435456 l26'
++ echo 'M 100644 :402653184 m26'
++ echo 'M 100644 :536870911 n26'
++ echo ':268435456 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':402653184 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ echo ':536870911 e69de29bb2d1d6434b8b29ae775ad8c2e48c5391'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tl26\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tm26\n'
++ printf '100644 blob e69de29bb2d1d6434b8b29ae775ad8c2e48c5391\tn26\n'
++ l=536870912
++ m=805306368
++ n=1073741823
++ i=27
++ test 27 -lt 27
++ sort tree.exp
++ cat input.blob input.commit
++ git fast-import --export-marks=marks.large
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 3 ( 80 duplicates )
blobs : 1 ( 80 duplicates 0 deltas of 0 attempts)
trees : 1 ( 0 duplicates 0 deltas of 0 attempts)
commits: 1 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1073741824 ( 81 unique )
atoms: 81
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 2
pack_report: pack_mmap_calls = 1
pack_report: pack_open_windows = 1 / 1
pack_report: pack_mapped = 441 / 441
---------------------------------------------------------------------
++ git ls-tree refs/heads/verify--dump-marks
++ test_cmp tree.exp_s tree.out
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u tree.exp_s tree.out
++ test_cmp marks.exp marks.large
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u marks.exp marks.large
ok 19 - A: export marks with large values
expecting success of 9300.20 'B: fail on invalid blob sha1':
test_tick &&
cat >input <<-INPUT_END &&
commit refs/heads/branch
mark :1
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
corrupt
COMMIT
from refs/heads/main
M 755 $(echo $ZERO_OID | sed -e "s/0$/1/") zero1
INPUT_END
test_when_finished "rm -f .git/objects/pack_* .git/objects/index_*" &&
test_must_fail git fast-import <input
++ test_tick
++ test -z set
++ test_tick=1112912233
++ GIT_COMMITTER_DATE='1112912233 -0700'
++ GIT_AUTHOR_DATE='1112912233 -0700'
++ export GIT_COMMITTER_DATE GIT_AUTHOR_DATE
++ cat
+++ echo 0000000000000000000000000000000000000000
+++ sed -e 's/0$/1/'
++ test_when_finished 'rm -f .git/objects/pack_* .git/objects/index_*'
++ test 0 = 0
++ test_cleanup='{ rm -f .git/objects/pack_* .git/objects/index_*
} && (exit "$eval_ret"); eval_ret=$?; :'
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
fatal: Blob not found: M 755 0000000000000000000000000000000000000001 zero1
fast-import: dumping crash report to .git/fast_import_crash_1943411
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ rm -f '.git/objects/pack_*' '.git/objects/index_*'
++ exit 0
++ eval_ret=0
++ :
ok 20 - B: fail on invalid blob sha1
expecting success of 9300.21 'B: accept branch name "TEMP_TAG"':
cat >input <<-INPUT_END &&
commit TEMP_TAG
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
tag base
COMMIT
from refs/heads/main
INPUT_END
test_when_finished "rm -f .git/TEMP_TAG && git gc --prune=now" &&
git fast-import <input &&
test $(test-tool ref-store main resolve-ref TEMP_TAG 0 | cut -f1 -d " " ) != "$ZERO_OID" &&
test $(git rev-parse main) = $(git rev-parse TEMP_TAG^)
++ cat
++ test_when_finished 'rm -f .git/TEMP_TAG && git gc --prune=now'
++ test 0 = 0
++ test_cleanup='{ rm -f .git/TEMP_TAG && git gc --prune=now
} && (exit "$eval_ret"); eval_ret=$?; :'
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 1 ( 0 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 0 ( 0 duplicates 0 deltas of 0 attempts)
commits: 1 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 3
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 4
pack_report: pack_mmap_calls = 2
pack_report: pack_open_windows = 2 / 2
pack_report: pack_mapped = 1030 / 1030
---------------------------------------------------------------------
+++ test-tool ref-store main resolve-ref TEMP_TAG 0
+++ cut -f1 -d ' '
++ test 087966c260020bfa5db8a9c22c17ac64ac7deaaf '!=' 0000000000000000000000000000000000000000
+++ git rev-parse main
+++ git rev-parse 'TEMP_TAG^'
++ test 5ba2d0485e3e071f4ccbfdb22c474b305ebd159c = 5ba2d0485e3e071f4ccbfdb22c474b305ebd159c
++ rm -f .git/TEMP_TAG
++ git gc --prune=now
Enumerating objects: 19, done.
Counting objects: 100% (19/19), done.
Delta compression using up to 4 threads
Compressing objects: 100% (13/13), done.
Writing objects: 100% (19/19), done.
Total 19 (delta 2), reused 17 (delta 0), pack-reused 0 (from 0)
++ exit 0
++ eval_ret=0
++ :
ok 21 - B: accept branch name "TEMP_TAG"
expecting success of 9300.22 'B: accept empty committer':
cat >input <<-INPUT_END &&
commit refs/heads/empty-committer-1
committer <> $GIT_COMMITTER_DATE
data <<COMMIT
empty commit
COMMIT
INPUT_END
test_when_finished "git update-ref -d refs/heads/empty-committer-1
git gc --prune=now" &&
git fast-import <input &&
out=$(git fsck) &&
echo "$out" &&
test -z "$out"
++ cat
++ test_when_finished 'git update-ref -d refs/heads/empty-committer-1
git gc --prune=now'
++ test 0 = 0
++ test_cleanup='{ git update-ref -d refs/heads/empty-committer-1
git gc --prune=now
} && (exit "$eval_ret"); eval_ret=$?; :'
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 2 ( 0 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 1 ( 0 duplicates 0 deltas of 0 attempts)
commits: 1 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 0
Memory total: 2399 KiB
pools: 2048 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 2
pack_report: pack_mmap_calls = 1
pack_report: pack_open_windows = 1 / 1
pack_report: pack_mapped = 139 / 139
---------------------------------------------------------------------
+++ git fsck
Checking ref database: 100% (1/1), done.
Checking object directories: 100% (256/256), done.
warning in tag 0e22025f0f5cea5d83b68c3dc9fc334571f7196c: missingTaggerEntry: invalid format - expected 'tagger' line
warning in tag 103553a16e02d76e288cec0f76240f1ad97caeb9: missingTaggerEntry: invalid format - expected 'tagger' line
warning in tag 42d861d649a1b87eb8083ad1d94d9220ecf2c35f: missingTaggerEntry: invalid format - expected 'tagger' line
warning in tag 3750af27267cae07dd3f8b7a9aac2291e374a66a: missingTaggerEntry: invalid format - expected 'tagger' line
warning in tag 56c14ce987117cf2e391ebef3dbab65e4c1ed202: missingTaggerEntry: invalid format - expected 'tagger' line
warning in tag e0764732957e237a858c7535fca3c2b966065dac: missingTaggerEntry: invalid format - expected 'tagger' line
Checking objects: 100% (21/21), done.
Verifying commits in commit graph: 100% (4/4), done.
++ out=
++ echo ''
++ test -z ''
++ git update-ref -d refs/heads/empty-committer-1
++ git gc --prune=now
Enumerating objects: 19, done.
Counting objects: 100% (19/19), done.
Delta compression using up to 4 threads
Compressing objects: 100% (11/11), done.
Writing objects: 100% (19/19), done.
Total 19 (delta 2), reused 19 (delta 2), pack-reused 0 (from 0)
++ exit 0
++ eval_ret=0
++ :
ok 22 - B: accept empty committer
expecting success of 9300.23 'B: reject invalid timezone':
cat >input <<-INPUT_END &&
commit refs/heads/invalid-timezone
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1234567890 +051800
data <<COMMIT
empty commit
COMMIT
INPUT_END
test_when_finished "git update-ref -d refs/heads/invalid-timezone" &&
test_must_fail git fast-import <input
++ cat
++ test_when_finished 'git update-ref -d refs/heads/invalid-timezone'
++ test 0 = 0
++ test_cleanup='{ git update-ref -d refs/heads/invalid-timezone
} && (exit "$eval_ret"); eval_ret=$?; :'
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
fatal: Invalid raw date "1234567890 +051800" in ident: C O Mitter <[email protected]> 1234567890 +051800
fast-import: dumping crash report to .git/fast_import_crash_1943450
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ git update-ref -d refs/heads/invalid-timezone
++ exit 0
++ eval_ret=0
++ :
ok 23 - B: reject invalid timezone
expecting success of 9300.24 'B: accept invalid timezone with raw-permissive':
cat >input <<-INPUT_END &&
commit refs/heads/invalid-timezone
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1234567890 +051800
data <<COMMIT
empty commit
COMMIT
INPUT_END
git init invalid-timezone &&
git -C invalid-timezone fast-import --date-format=raw-permissive <input &&
git -C invalid-timezone cat-file -p invalid-timezone >out &&
grep "1234567890 [+]051800" out
++ cat
++ git init invalid-timezone
Initialized empty Git repository in /var/tmp/b/git/t/trash directory.t9300-fast-import/invalid-timezone/.git/
++ git -C invalid-timezone fast-import --date-format=raw-permissive
Unpacking objects: 100% (2/2), 145 bytes | 72.00 KiB/s, done.
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 2 ( 0 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 1 ( 0 duplicates 0 deltas of 0 attempts)
commits: 1 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 0
Memory total: 2399 KiB
pools: 2048 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 0
pack_report: pack_mmap_calls = 0
pack_report: pack_open_windows = 0 / 0
pack_report: pack_mapped = 0 / 0
---------------------------------------------------------------------
++ git -C invalid-timezone cat-file -p invalid-timezone
++ grep '1234567890 [+]051800' out
author C O Mitter <[email protected]> 1234567890 +051800
committer C O Mitter <[email protected]> 1234567890 +051800
ok 24 - B: accept invalid timezone with raw-permissive
expecting success of 9300.25 'B: accept and fixup committer with no name':
cat >input <<-INPUT_END &&
commit refs/heads/empty-committer-2
committer <[email protected]> $GIT_COMMITTER_DATE
data <<COMMIT
empty commit
COMMIT
INPUT_END
test_when_finished "git update-ref -d refs/heads/empty-committer-2
git gc --prune=now" &&
git fast-import <input &&
out=$(git fsck) &&
echo "$out" &&
test -z "$out"
++ cat
++ test_when_finished 'git update-ref -d refs/heads/empty-committer-2
git gc --prune=now'
++ test 0 = 0
++ test_cleanup='{ git update-ref -d refs/heads/empty-committer-2
git gc --prune=now
} && (exit "$eval_ret"); eval_ret=$?; :'
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 2 ( 0 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 1 ( 0 duplicates 0 deltas of 0 attempts)
commits: 1 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 0
Memory total: 2399 KiB
pools: 2048 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 2
pack_report: pack_mmap_calls = 1
pack_report: pack_open_windows = 1 / 1
pack_report: pack_mapped = 146 / 146
---------------------------------------------------------------------
+++ git fsck
Checking ref database: 100% (1/1), done.
Checking object directories: 100% (256/256), done.
warning in tag 0e22025f0f5cea5d83b68c3dc9fc334571f7196c: missingTaggerEntry: invalid format - expected 'tagger' line
warning in tag 103553a16e02d76e288cec0f76240f1ad97caeb9: missingTaggerEntry: invalid format - expected 'tagger' line
warning in tag 42d861d649a1b87eb8083ad1d94d9220ecf2c35f: missingTaggerEntry: invalid format - expected 'tagger' line
warning in tag 3750af27267cae07dd3f8b7a9aac2291e374a66a: missingTaggerEntry: invalid format - expected 'tagger' line
warning in tag 56c14ce987117cf2e391ebef3dbab65e4c1ed202: missingTaggerEntry: invalid format - expected 'tagger' line
warning in tag e0764732957e237a858c7535fca3c2b966065dac: missingTaggerEntry: invalid format - expected 'tagger' line
Checking objects: 100% (21/21), done.
Verifying commits in commit graph: 100% (4/4), done.
++ out=
++ echo ''
++ test -z ''
++ git update-ref -d refs/heads/empty-committer-2
++ git gc --prune=now
Enumerating objects: 19, done.
Counting objects: 100% (19/19), done.
Delta compression using up to 4 threads
Compressing objects: 100% (11/11), done.
Writing objects: 100% (19/19), done.
Total 19 (delta 2), reused 19 (delta 2), pack-reused 0 (from 0)
++ exit 0
++ eval_ret=0
++ :
ok 25 - B: accept and fixup committer with no name
expecting success of 9300.26 'B: fail on invalid committer (1)':
cat >input <<-INPUT_END &&
commit refs/heads/invalid-committer
committer Name email> $GIT_COMMITTER_DATE
data <<COMMIT
empty commit
COMMIT
INPUT_END
test_when_finished "git update-ref -d refs/heads/invalid-committer" &&
test_must_fail git fast-import <input
++ cat
++ test_when_finished 'git update-ref -d refs/heads/invalid-committer'
++ test 0 = 0
++ test_cleanup='{ git update-ref -d refs/heads/invalid-committer
} && (exit "$eval_ret"); eval_ret=$?; :'
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
fatal: Missing < in ident string: Name email> 1112912233 -0700
fast-import: dumping crash report to .git/fast_import_crash_1943477
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ git update-ref -d refs/heads/invalid-committer
++ exit 0
++ eval_ret=0
++ :
ok 26 - B: fail on invalid committer (1)
expecting success of 9300.27 'B: fail on invalid committer (2)':
cat >input <<-INPUT_END &&
commit refs/heads/invalid-committer
committer Name <e<mail> $GIT_COMMITTER_DATE
data <<COMMIT
empty commit
COMMIT
INPUT_END
test_when_finished "git update-ref -d refs/heads/invalid-committer" &&
test_must_fail git fast-import <input
++ cat
++ test_when_finished 'git update-ref -d refs/heads/invalid-committer'
++ test 0 = 0
++ test_cleanup='{ git update-ref -d refs/heads/invalid-committer
} && (exit "$eval_ret"); eval_ret=$?; :'
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
fatal: Missing > in ident string: Name <e<mail> 1112912233 -0700
fast-import: dumping crash report to .git/fast_import_crash_1943481
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ git update-ref -d refs/heads/invalid-committer
++ exit 0
++ eval_ret=0
++ :
ok 27 - B: fail on invalid committer (2)
expecting success of 9300.28 'B: fail on invalid committer (3)':
cat >input <<-INPUT_END &&
commit refs/heads/invalid-committer
committer Name <email>> $GIT_COMMITTER_DATE
data <<COMMIT
empty commit
COMMIT
INPUT_END
test_when_finished "git update-ref -d refs/heads/invalid-committer" &&
test_must_fail git fast-import <input
++ cat
++ test_when_finished 'git update-ref -d refs/heads/invalid-committer'
++ test 0 = 0
++ test_cleanup='{ git update-ref -d refs/heads/invalid-committer
} && (exit "$eval_ret"); eval_ret=$?; :'
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
fatal: Missing space after > in ident string: Name <email>> 1112912233 -0700
fast-import: dumping crash report to .git/fast_import_crash_1943485
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ git update-ref -d refs/heads/invalid-committer
++ exit 0
++ eval_ret=0
++ :
ok 28 - B: fail on invalid committer (3)
expecting success of 9300.29 'B: fail on invalid committer (4)':
cat >input <<-INPUT_END &&
commit refs/heads/invalid-committer
committer Name <email $GIT_COMMITTER_DATE
data <<COMMIT
empty commit
COMMIT
INPUT_END
test_when_finished "git update-ref -d refs/heads/invalid-committer" &&
test_must_fail git fast-import <input
++ cat
++ test_when_finished 'git update-ref -d refs/heads/invalid-committer'
++ test 0 = 0
++ test_cleanup='{ git update-ref -d refs/heads/invalid-committer
} && (exit "$eval_ret"); eval_ret=$?; :'
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
fatal: Missing > in ident string: Name <email 1112912233 -0700
fast-import: dumping crash report to .git/fast_import_crash_1943489
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ git update-ref -d refs/heads/invalid-committer
++ exit 0
++ eval_ret=0
++ :
ok 29 - B: fail on invalid committer (4)
expecting success of 9300.30 'B: fail on invalid committer (5)':
cat >input <<-INPUT_END &&
commit refs/heads/invalid-committer
committer Name<email> $GIT_COMMITTER_DATE
data <<COMMIT
empty commit
COMMIT
INPUT_END
test_when_finished "git update-ref -d refs/heads/invalid-committer" &&
test_must_fail git fast-import <input
++ cat
++ test_when_finished 'git update-ref -d refs/heads/invalid-committer'
++ test 0 = 0
++ test_cleanup='{ git update-ref -d refs/heads/invalid-committer
} && (exit "$eval_ret"); eval_ret=$?; :'
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
fatal: Missing space before < in ident string: Name<email> 1112912233 -0700
fast-import: dumping crash report to .git/fast_import_crash_1943493
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ git update-ref -d refs/heads/invalid-committer
++ exit 0
++ eval_ret=0
++ :
ok 30 - B: fail on invalid committer (5)
expecting success of 9300.31 'B: fail on invalid file path of ..':
cat >input <<-INPUT_END &&
blob
mark :1
data <<EOF
File contents
EOF
commit refs/heads/badpath
committer Name <email> $GIT_COMMITTER_DATE
data <<COMMIT
Commit Message
COMMIT
M 100644 :1 ../invalid-path
INPUT_END
test_when_finished "git update-ref -d refs/heads/badpath" &&
test_must_fail git fast-import <input
++ cat
++ test_when_finished 'git update-ref -d refs/heads/badpath'
++ test 0 = 0
++ test_cleanup='{ git update-ref -d refs/heads/badpath
} && (exit "$eval_ret"); eval_ret=$?; :'
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
fatal: invalid path '../invalid-path'
fast-import: dumping crash report to .git/fast_import_crash_1943497
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ git update-ref -d refs/heads/badpath
++ exit 0
++ eval_ret=0
++ :
ok 31 - B: fail on invalid file path of ..
expecting success of 9300.32 'B: fail on invalid file path of .':
cat >input <<-INPUT_END &&
blob
mark :1
data <<EOF
File contents
EOF
commit refs/heads/badpath
committer Name <email> $GIT_COMMITTER_DATE
data <<COMMIT
Good path
COMMIT
M 100644 :1 ok-path
commit refs/heads/badpath
committer Name <email> $GIT_COMMITTER_DATE
data <<COMMIT
Bad path
COMMIT
R ok-path ./invalid-path
INPUT_END
test_when_finished "git update-ref -d refs/heads/badpath" &&
test_must_fail git fast-import <input
++ cat
++ test_when_finished 'git update-ref -d refs/heads/badpath'
++ test 0 = 0
++ test_cleanup='{ git update-ref -d refs/heads/badpath
} && (exit "$eval_ret"); eval_ret=$?; :'
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
fatal: invalid path './invalid-path'
fast-import: dumping crash report to .git/fast_import_crash_1943501
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ git update-ref -d refs/heads/badpath
++ exit 0
++ eval_ret=0
++ :
ok 32 - B: fail on invalid file path of .
ok 33 # skip B: fail on invalid file path of C: (missing WINDOWS)
expecting success of 9300.34 'B: fail on invalid file path of .git':
cat >input <<-INPUT_END &&
blob
mark :1
data <<EOF
File contents
EOF
commit refs/heads/badpath
committer Name <email> $GIT_COMMITTER_DATE
data <<COMMIT
Commit Message
COMMIT
M 100644 :1 .git/invalid-path
INPUT_END
test_when_finished "git update-ref -d refs/heads/badpath" &&
test_must_fail git fast-import <input
++ cat
++ test_when_finished 'git update-ref -d refs/heads/badpath'
++ test 0 = 0
++ test_cleanup='{ git update-ref -d refs/heads/badpath
} && (exit "$eval_ret"); eval_ret=$?; :'
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
fatal: invalid path '.git/invalid-path'
fast-import: dumping crash report to .git/fast_import_crash_1943506
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ git update-ref -d refs/heads/badpath
++ exit 0
++ eval_ret=0
++ :
ok 34 - B: fail on invalid file path of .git
expecting success of 9300.35 'B: fail on invalid file path of .gitmodules':
cat >input <<-INPUT_END &&
blob
mark :1
data <<EOF
File contents
EOF
commit refs/heads/badpath
committer Name <email> $GIT_COMMITTER_DATE
data <<COMMIT
Commit Message
COMMIT
M 120000 :1 .gitmodules
INPUT_END
test_when_finished "git update-ref -d refs/heads/badpath" &&
test_must_fail git fast-import <input
++ cat
++ test_when_finished 'git update-ref -d refs/heads/badpath'
++ test 0 = 0
++ test_cleanup='{ git update-ref -d refs/heads/badpath
} && (exit "$eval_ret"); eval_ret=$?; :'
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
fatal: invalid path '.gitmodules'
fast-import: dumping crash report to .git/fast_import_crash_1943510
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ git update-ref -d refs/heads/badpath
++ exit 0
++ eval_ret=0
++ :
ok 35 - B: fail on invalid file path of .gitmodules
expecting success of 9300.36 'C: incremental import create pack from stdin':
newf=$(echo hi newf | git hash-object -w --stdin) &&
oldf=$(git rev-parse --verify main:file2) &&
thrf=$(git rev-parse --verify main:file3) &&
test_tick &&
cat >input <<-INPUT_END &&
commit refs/heads/branch
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
second
COMMIT
from refs/heads/main
M 644 $oldf file2/oldf
M 755 $newf file2/newf
D file3
INPUT_END
git fast-import <input &&
git whatchanged branch
+++ echo hi newf
+++ git hash-object -w --stdin
++ newf=f1fb5da718392694d0076d677d6d0e364c79b0bc
+++ git rev-parse --verify main:file2
++ oldf=7123f7f44e39be127c5eb701e5968176ee9d78b1
+++ git rev-parse --verify main:file3
++ thrf=0d92e9f3374ae2947c23aa477cbc68ce598135f1
++ test_tick
++ test -z set
++ test_tick=1112912293
++ GIT_COMMITTER_DATE='1112912293 -0700'
++ GIT_AUTHOR_DATE='1112912293 -0700'
++ export GIT_COMMITTER_DATE GIT_AUTHOR_DATE
++ cat
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 3 ( 0 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 2 ( 0 duplicates 0 deltas of 0 attempts)
commits: 1 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 5
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 5
pack_report: pack_mmap_calls = 2
pack_report: pack_open_windows = 2 / 2
pack_report: pack_mapped = 1943 / 1943
---------------------------------------------------------------------
++ git whatchanged branch
commit fe28762c62291fb256d192177ba8264d159a3872 (branch)
Author: C O Mitter <[email protected]>
Date: Thu Apr 7 15:18:13 2005 -0700
second
:000000 100755 0000000 f1fb5da A file2/newf
:100644 100644 7123f7f 7123f7f R100 file2 file2/oldf
:100644 000000 0d92e9f 0000000 D file3
commit 5ba2d0485e3e071f4ccbfdb22c474b305ebd159c (HEAD -> main, tag: series-A)
Author: C O Mitter <[email protected]>
Date: Thu Apr 7 15:13:13 2005 -0700
initial
:000000 100644 0000000 7123f7f A file2
:000000 100644 0000000 0d92e9f A file3
:000000 100755 0000000 85df507 A file4
ok 36 - C: incremental import create pack from stdin
expecting success of 9300.37 'C: verify pack':
verify_packs
++ verify_packs
++ for p in .git/objects/pack/*.pack
++ git verify-pack .git/objects/pack/pack-398c1c59898137d3fe062aa756f5cc065369c2d7.pack
++ for p in .git/objects/pack/*.pack
++ git verify-pack .git/objects/pack/pack-4ff252e0c02deb1160eb6cb077b6ddc9cc72721d.pack
++ for p in .git/objects/pack/*.pack
++ git verify-pack .git/objects/pack/pack-5d927ff3f597ee92a4f3421cc7f6a60ebe96a748.pack
++ for p in .git/objects/pack/*.pack
++ git verify-pack .git/objects/pack/pack-acf012d0b2defa9599010288ead5b7f73fdf7da4.pack
ok 37 - C: verify pack
expecting success of 9300.38 'C: validate reuse existing blob':
test $newf = $(git rev-parse --verify branch:file2/newf) &&
test $oldf = $(git rev-parse --verify branch:file2/oldf)
+++ git rev-parse --verify branch:file2/newf
++ test f1fb5da718392694d0076d677d6d0e364c79b0bc = f1fb5da718392694d0076d677d6d0e364c79b0bc
+++ git rev-parse --verify branch:file2/oldf
++ test 7123f7f44e39be127c5eb701e5968176ee9d78b1 = 7123f7f44e39be127c5eb701e5968176ee9d78b1
ok 38 - C: validate reuse existing blob
expecting success of 9300.39 'C: verify commit':
cat >expect <<-EOF &&
parent $(git rev-parse --verify main^0)
author $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
second
EOF
git cat-file commit branch | sed 1d >actual &&
test_cmp expect actual
++ cat
+++ git rev-parse --verify 'main^0'
++ git cat-file commit branch
++ sed 1d
++ test_cmp expect actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual
ok 39 - C: verify commit
expecting success of 9300.40 'C: validate rename result':
zero=$ZERO_OID &&
cat >expect <<-EOF &&
:000000 100755 $zero $newf A file2/newf
:100644 100644 $oldf $oldf R100 file2 file2/oldf
:100644 000000 $thrf $zero D file3
EOF
git diff-tree -M -r main branch >actual &&
compare_diff_raw expect actual
++ zero=0000000000000000000000000000000000000000
++ cat
++ git diff-tree -M -r main branch
++ compare_diff_raw expect actual
++ sed -e '/^:/s/ \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([A-Z]\)[0-9]* / \1 \2 \3# /'
++ sed -e '/^:/s/ \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([A-Z]\)[0-9]* / \1 \2 \3# /'
++ test_cmp .tmp-1 .tmp-2
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u .tmp-1 .tmp-2
++ rm -f .tmp-1 .tmp-2
ok 40 - C: validate rename result
expecting success of 9300.41 'D: inline data in commit':
test_tick &&
cat >input <<-INPUT_END &&
commit refs/heads/branch
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
third
COMMIT
from refs/heads/branch^0
M 644 inline newdir/interesting
data <<EOF
$file5_data
EOF
M 755 inline newdir/exec.sh
data <<EOF
$file6_data
EOF
INPUT_END
git fast-import <input &&
git whatchanged branch
++ test_tick
++ test -z set
++ test_tick=1112912353
++ GIT_COMMITTER_DATE='1112912353 -0700'
++ GIT_AUTHOR_DATE='1112912353 -0700'
++ export GIT_COMMITTER_DATE GIT_AUTHOR_DATE
++ cat
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 5 ( 0 duplicates )
blobs : 2 ( 0 duplicates 0 deltas of 0 attempts)
trees : 2 ( 0 duplicates 0 deltas of 0 attempts)
commits: 1 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 5
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 6
pack_report: pack_mmap_calls = 2
pack_report: pack_open_windows = 2 / 2
pack_report: pack_mapped = 786 / 786
---------------------------------------------------------------------
++ git whatchanged branch
commit f3aa51c819f0b3cc0ee594d10afaf6c84d7da579 (branch)
Author: C O Mitter <[email protected]>
Date: Thu Apr 7 15:19:13 2005 -0700
third
:000000 100755 0000000 e74b7d4 A newdir/exec.sh
:000000 100644 0000000 fcf778c A newdir/interesting
commit fe28762c62291fb256d192177ba8264d159a3872
Author: C O Mitter <[email protected]>
Date: Thu Apr 7 15:18:13 2005 -0700
second
:000000 100755 0000000 f1fb5da A file2/newf
:100644 100644 7123f7f 7123f7f R100 file2 file2/oldf
:100644 000000 0d92e9f 0000000 D file3
commit 5ba2d0485e3e071f4ccbfdb22c474b305ebd159c (HEAD -> main, tag: series-A)
Author: C O Mitter <[email protected]>
Date: Thu Apr 7 15:13:13 2005 -0700
initial
:000000 100644 0000000 7123f7f A file2
:000000 100644 0000000 0d92e9f A file3
:000000 100755 0000000 85df507 A file4
ok 41 - D: inline data in commit
expecting success of 9300.42 'D: verify pack':
verify_packs
++ verify_packs
++ for p in .git/objects/pack/*.pack
++ git verify-pack .git/objects/pack/pack-398c1c59898137d3fe062aa756f5cc065369c2d7.pack
++ for p in .git/objects/pack/*.pack
++ git verify-pack .git/objects/pack/pack-4ff252e0c02deb1160eb6cb077b6ddc9cc72721d.pack
++ for p in .git/objects/pack/*.pack
++ git verify-pack .git/objects/pack/pack-5d927ff3f597ee92a4f3421cc7f6a60ebe96a748.pack
++ for p in .git/objects/pack/*.pack
++ git verify-pack .git/objects/pack/pack-acf012d0b2defa9599010288ead5b7f73fdf7da4.pack
++ for p in .git/objects/pack/*.pack
++ git verify-pack .git/objects/pack/pack-da43e1258e5681a2c14dac055ae5f8aecc2c620f.pack
ok 42 - D: verify pack
expecting success of 9300.43 'D: validate new files added':
f5id=$(echo "$file5_data" | git hash-object --stdin) &&
f6id=$(echo "$file6_data" | git hash-object --stdin) &&
cat >expect <<-EOF &&
:000000 100755 $ZERO_OID $f6id A newdir/exec.sh
:000000 100644 $ZERO_OID $f5id A newdir/interesting
EOF
git diff-tree -M -r branch^ branch >actual &&
compare_diff_raw expect actual
+++ echo 'an inline file.
we should see it later.'
+++ git hash-object --stdin
++ f5id=fcf778cda181eaa1cbc9e9ce3a2e15ee9f9fe791
+++ echo '#!/bin/sh
echo "$@"'
+++ git hash-object --stdin
++ f6id=e74b7d465e52746be2b4bae983670711e6e66657
++ cat
++ git diff-tree -M -r 'branch^' branch
++ compare_diff_raw expect actual
++ sed -e '/^:/s/ \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([A-Z]\)[0-9]* / \1 \2 \3# /'
++ sed -e '/^:/s/ \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([A-Z]\)[0-9]* / \1 \2 \3# /'
++ test_cmp .tmp-1 .tmp-2
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u .tmp-1 .tmp-2
++ rm -f .tmp-1 .tmp-2
ok 43 - D: validate new files added
expecting success of 9300.44 'D: verify file5':
echo "$file5_data" >expect &&
git cat-file blob branch:newdir/interesting >actual &&
test_cmp expect actual
++ echo 'an inline file.
we should see it later.'
++ git cat-file blob branch:newdir/interesting
++ test_cmp expect actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual
ok 44 - D: verify file5
expecting success of 9300.45 'D: verify file6':
echo "$file6_data" >expect &&
git cat-file blob branch:newdir/exec.sh >actual &&
test_cmp expect actual
++ echo '#!/bin/sh
echo "$@"'
++ git cat-file blob branch:newdir/exec.sh
++ test_cmp expect actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual
ok 45 - D: verify file6
expecting success of 9300.46 'E: rfc2822 date, --date-format=raw':
cat >input <<-INPUT_END &&
commit refs/heads/branch
author $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL> Tue Feb 6 11:22:18 2007 -0500
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> Tue Feb 6 12:35:02 2007 -0500
data <<COMMIT
RFC 2822 type date
COMMIT
from refs/heads/branch^0
INPUT_END
test_must_fail git fast-import --date-format=raw <input
++ cat
++ test_must_fail git fast-import --date-format=raw
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import --date-format=raw
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import --date-format=raw
fatal: Invalid raw date "Tue Feb 6 11:22:18 2007 -0500" in ident: A U Thor <[email protected]> Tue Feb 6 11:22:18 2007 -0500
fast-import: dumping crash report to .git/fast_import_crash_1943578
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
ok 46 - E: rfc2822 date, --date-format=raw
expecting success of 9300.47 'E: rfc2822 date, --date-format=rfc2822':
git fast-import --date-format=rfc2822 <input
++ git fast-import --date-format=rfc2822
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 1 ( 0 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 0 ( 0 duplicates 0 deltas of 0 attempts)
commits: 1 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 3
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 6
pack_report: pack_mmap_calls = 2
pack_report: pack_open_windows = 2 / 2
pack_report: pack_mapped = 656 / 656
---------------------------------------------------------------------
ok 47 - E: rfc2822 date, --date-format=rfc2822
expecting success of 9300.48 'E: verify pack':
verify_packs
++ verify_packs
++ for p in .git/objects/pack/*.pack
++ git verify-pack .git/objects/pack/pack-398c1c59898137d3fe062aa756f5cc065369c2d7.pack
++ for p in .git/objects/pack/*.pack
++ git verify-pack .git/objects/pack/pack-4ff252e0c02deb1160eb6cb077b6ddc9cc72721d.pack
++ for p in .git/objects/pack/*.pack
++ git verify-pack .git/objects/pack/pack-5d927ff3f597ee92a4f3421cc7f6a60ebe96a748.pack
++ for p in .git/objects/pack/*.pack
++ git verify-pack .git/objects/pack/pack-acf012d0b2defa9599010288ead5b7f73fdf7da4.pack
++ for p in .git/objects/pack/*.pack
++ git verify-pack .git/objects/pack/pack-d050dac6ce50e940f88925f24414ac0bbdb79ec0.pack
++ for p in .git/objects/pack/*.pack
++ git verify-pack .git/objects/pack/pack-da43e1258e5681a2c14dac055ae5f8aecc2c620f.pack
ok 48 - E: verify pack
expecting success of 9300.49 'E: verify commit':
cat >expect <<-EOF &&
author $GIT_AUTHOR_NAME <$GIT_AUTHOR_EMAIL> 1170778938 -0500
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> 1170783302 -0500
RFC 2822 type date
EOF
git cat-file commit branch | sed 1,2d >actual &&
test_cmp expect actual
++ cat
++ sed 1,2d
++ git cat-file commit branch
++ test_cmp expect actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual
ok 49 - E: verify commit
expecting success of 9300.50 'F: non-fast-forward update skips':
old_branch=$(git rev-parse --verify branch^0) &&
test_tick &&
cat >input <<-INPUT_END &&
commit refs/heads/branch
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
losing things already?
COMMIT
from refs/heads/branch~1
reset refs/heads/other
from refs/heads/branch
INPUT_END
test_must_fail git fast-import <input &&
# branch must remain unaffected
test $old_branch = $(git rev-parse --verify branch^0)
+++ git rev-parse --verify 'branch^0'
++ old_branch=de5766c434bb93360ee19879605fe31f25cdcf20
++ test_tick
++ test -z set
++ test_tick=1112912413
++ GIT_COMMITTER_DATE='1112912413 -0700'
++ GIT_AUTHOR_DATE='1112912413 -0700'
++ export GIT_COMMITTER_DATE GIT_AUTHOR_DATE
++ cat
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
warning: Not updating refs/heads/branch (new tip fb7baf16109664b6b1d3b3c98d6c252fa7051ae5 does not contain de5766c434bb93360ee19879605fe31f25cdcf20)
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 1 ( 0 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 0 ( 0 duplicates 0 deltas of 0 attempts)
commits: 1 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 2 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 3
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 8
pack_report: pack_mmap_calls = 4
pack_report: pack_open_windows = 4 / 4
pack_report: pack_mapped = 1183 / 1183
---------------------------------------------------------------------
++ exit_code=1
++ test 1 -eq 0
++ test_match_signal 13 1
++ test 1 = 141
++ test 1 = 269
++ return 1
++ test 1 -gt 129
++ test 1 -eq 127
++ test 1 -eq 126
++ return 0
+++ git rev-parse --verify 'branch^0'
++ test de5766c434bb93360ee19879605fe31f25cdcf20 = de5766c434bb93360ee19879605fe31f25cdcf20
ok 50 - F: non-fast-forward update skips
expecting success of 9300.51 'F: verify pack':
verify_packs
++ verify_packs
++ for p in .git/objects/pack/*.pack
++ git verify-pack .git/objects/pack/pack-398c1c59898137d3fe062aa756f5cc065369c2d7.pack
++ for p in .git/objects/pack/*.pack
++ git verify-pack .git/objects/pack/pack-4ff252e0c02deb1160eb6cb077b6ddc9cc72721d.pack
++ for p in .git/objects/pack/*.pack
++ git verify-pack .git/objects/pack/pack-5d927ff3f597ee92a4f3421cc7f6a60ebe96a748.pack
++ for p in .git/objects/pack/*.pack
++ git verify-pack .git/objects/pack/pack-6c095243408d2483a8f39812362cb5d40ac98ede.pack
++ for p in .git/objects/pack/*.pack
++ git verify-pack .git/objects/pack/pack-acf012d0b2defa9599010288ead5b7f73fdf7da4.pack
++ for p in .git/objects/pack/*.pack
++ git verify-pack .git/objects/pack/pack-d050dac6ce50e940f88925f24414ac0bbdb79ec0.pack
++ for p in .git/objects/pack/*.pack
++ git verify-pack .git/objects/pack/pack-da43e1258e5681a2c14dac055ae5f8aecc2c620f.pack
ok 51 - F: verify pack
expecting success of 9300.52 'F: verify other commit':
cat >expect <<-EOF &&
tree $(git rev-parse branch~1^{tree})
parent $(git rev-parse branch~1)
author $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
losing things already?
EOF
git cat-file commit other >actual &&
test_cmp expect actual
++ cat
+++ git rev-parse 'branch~1^{tree}'
+++ git rev-parse branch~1
++ git cat-file commit other
++ test_cmp expect actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual
ok 52 - F: verify other commit
expecting success of 9300.53 'G: non-fast-forward update forced':
old_branch=$(git rev-parse --verify branch^0) &&
test_tick &&
cat >input <<-INPUT_END &&
commit refs/heads/branch
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
losing things already?
COMMIT
from refs/heads/branch~1
INPUT_END
git fast-import --force <input
+++ git rev-parse --verify 'branch^0'
++ old_branch=de5766c434bb93360ee19879605fe31f25cdcf20
++ test_tick
++ test -z set
++ test_tick=1112912473
++ GIT_COMMITTER_DATE='1112912473 -0700'
++ GIT_AUTHOR_DATE='1112912473 -0700'
++ export GIT_COMMITTER_DATE GIT_AUTHOR_DATE
++ cat
++ git fast-import --force
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 1 ( 0 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 0 ( 0 duplicates 0 deltas of 0 attempts)
commits: 1 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 3
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 6
pack_report: pack_mmap_calls = 3
pack_report: pack_open_windows = 3 / 3
pack_report: pack_mapped = 850 / 850
---------------------------------------------------------------------
ok 53 - G: non-fast-forward update forced
expecting success of 9300.54 'G: verify pack':
verify_packs
++ verify_packs
++ for p in .git/objects/pack/*.pack
++ git verify-pack .git/objects/pack/pack-398c1c59898137d3fe062aa756f5cc065369c2d7.pack
++ for p in .git/objects/pack/*.pack
++ git verify-pack .git/objects/pack/pack-4538c70df7f1f1681740c56b961d57dd5ab39742.pack
++ for p in .git/objects/pack/*.pack
++ git verify-pack .git/objects/pack/pack-4ff252e0c02deb1160eb6cb077b6ddc9cc72721d.pack
++ for p in .git/objects/pack/*.pack
++ git verify-pack .git/objects/pack/pack-5d927ff3f597ee92a4f3421cc7f6a60ebe96a748.pack
++ for p in .git/objects/pack/*.pack
++ git verify-pack .git/objects/pack/pack-6c095243408d2483a8f39812362cb5d40ac98ede.pack
++ for p in .git/objects/pack/*.pack
++ git verify-pack .git/objects/pack/pack-acf012d0b2defa9599010288ead5b7f73fdf7da4.pack
++ for p in .git/objects/pack/*.pack
++ git verify-pack .git/objects/pack/pack-d050dac6ce50e940f88925f24414ac0bbdb79ec0.pack
++ for p in .git/objects/pack/*.pack
++ git verify-pack .git/objects/pack/pack-da43e1258e5681a2c14dac055ae5f8aecc2c620f.pack
ok 54 - G: verify pack
expecting success of 9300.55 'G: branch changed, but logged':
test $old_branch != $(git rev-parse --verify branch^0) &&
test $old_branch = $(git rev-parse --verify branch@{1})
+++ git rev-parse --verify 'branch^0'
++ test de5766c434bb93360ee19879605fe31f25cdcf20 '!=' f9eb178a57581c4b6ee59a2a22ee91689c065e26
+++ git rev-parse --verify 'branch@{1}'
++ test de5766c434bb93360ee19879605fe31f25cdcf20 = de5766c434bb93360ee19879605fe31f25cdcf20
ok 55 - G: branch changed, but logged
expecting success of 9300.56 'H: deletall, add 1':
test_tick &&
cat >input <<-INPUT_END &&
commit refs/heads/H
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
third
COMMIT
from refs/heads/branch^0
M 644 inline i-will-die
data <<EOF
this file will never exist.
EOF
deleteall
M 644 inline h/e/l/lo
data <<EOF
$file5_data
EOF
INPUT_END
git fast-import <input &&
git whatchanged H
++ test_tick
++ test -z set
++ test_tick=1112912533
++ GIT_COMMITTER_DATE='1112912533 -0700'
++ GIT_AUTHOR_DATE='1112912533 -0700'
++ export GIT_COMMITTER_DATE GIT_AUTHOR_DATE
++ cat
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 6 ( 1 duplicates )
blobs : 1 ( 1 duplicates 0 deltas of 0 attempts)
trees : 4 ( 0 duplicates 0 deltas of 0 attempts)
commits: 1 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 8
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 6
pack_report: pack_mmap_calls = 3
pack_report: pack_open_windows = 3 / 3
pack_report: pack_mapped = 1026 / 1026
---------------------------------------------------------------------
++ git whatchanged H
commit 8c1bf1b9f891df8805c27a54986e5043829939ad (H)
Author: C O Mitter <[email protected]>
Date: Thu Apr 7 15:22:13 2005 -0700
third
:100755 000000 f1fb5da 0000000 D file2/newf
:100644 000000 7123f7f 0000000 D file2/oldf
:100755 000000 85df507 0000000 D file4
:100644 100644 fcf778c fcf778c R100 newdir/interesting h/e/l/lo
:100755 000000 e74b7d4 0000000 D newdir/exec.sh
commit f3aa51c819f0b3cc0ee594d10afaf6c84d7da579
Author: C O Mitter <[email protected]>
Date: Thu Apr 7 15:19:13 2005 -0700
third
:000000 100755 0000000 e74b7d4 A newdir/exec.sh
:000000 100644 0000000 fcf778c A newdir/interesting
commit fe28762c62291fb256d192177ba8264d159a3872
Author: C O Mitter <[email protected]>
Date: Thu Apr 7 15:18:13 2005 -0700
second
:000000 100755 0000000 f1fb5da A file2/newf
:100644 100644 7123f7f 7123f7f R100 file2 file2/oldf
:100644 000000 0d92e9f 0000000 D file3
commit 5ba2d0485e3e071f4ccbfdb22c474b305ebd159c (HEAD -> main, tag: series-A)
Author: C O Mitter <[email protected]>
Date: Thu Apr 7 15:13:13 2005 -0700
initial
:000000 100644 0000000 7123f7f A file2
:000000 100644 0000000 0d92e9f A file3
:000000 100755 0000000 85df507 A file4
ok 56 - H: deletall, add 1
expecting success of 9300.57 'H: verify pack':
verify_packs
++ verify_packs
++ for p in .git/objects/pack/*.pack
++ git verify-pack .git/objects/pack/pack-398c1c59898137d3fe062aa756f5cc065369c2d7.pack
++ for p in .git/objects/pack/*.pack
++ git verify-pack .git/objects/pack/pack-4538c70df7f1f1681740c56b961d57dd5ab39742.pack
++ for p in .git/objects/pack/*.pack
++ git verify-pack .git/objects/pack/pack-4ff252e0c02deb1160eb6cb077b6ddc9cc72721d.pack
++ for p in .git/objects/pack/*.pack
++ git verify-pack .git/objects/pack/pack-5d927ff3f597ee92a4f3421cc7f6a60ebe96a748.pack
++ for p in .git/objects/pack/*.pack
++ git verify-pack .git/objects/pack/pack-6c095243408d2483a8f39812362cb5d40ac98ede.pack
++ for p in .git/objects/pack/*.pack
++ git verify-pack .git/objects/pack/pack-acf012d0b2defa9599010288ead5b7f73fdf7da4.pack
++ for p in .git/objects/pack/*.pack
++ git verify-pack .git/objects/pack/pack-d050dac6ce50e940f88925f24414ac0bbdb79ec0.pack
++ for p in .git/objects/pack/*.pack
++ git verify-pack .git/objects/pack/pack-da43e1258e5681a2c14dac055ae5f8aecc2c620f.pack
++ for p in .git/objects/pack/*.pack
++ git verify-pack .git/objects/pack/pack-e55548bb40f8c6f027682a7602647c1517c1feea.pack
ok 57 - H: verify pack
expecting success of 9300.58 'H: validate old files removed, new files added':
f4id=$(git rev-parse HEAD:file4) &&
cat >expect <<-EOF &&
:100755 000000 $newf $zero D file2/newf
:100644 000000 $oldf $zero D file2/oldf
:100755 000000 $f4id $zero D file4
:100644 100644 $f5id $f5id R100 newdir/interesting h/e/l/lo
:100755 000000 $f6id $zero D newdir/exec.sh
EOF
git diff-tree -M -r H^ H >actual &&
compare_diff_raw expect actual
+++ git rev-parse HEAD:file4
++ f4id=85df50785d62d3b05ab03d9cbf7e4a0b49449730
++ cat
++ git diff-tree -M -r 'H^' H
++ compare_diff_raw expect actual
++ sed -e '/^:/s/ \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([A-Z]\)[0-9]* / \1 \2 \3# /'
++ sed -e '/^:/s/ \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([A-Z]\)[0-9]* / \1 \2 \3# /'
++ test_cmp .tmp-1 .tmp-2
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u .tmp-1 .tmp-2
++ rm -f .tmp-1 .tmp-2
ok 58 - H: validate old files removed, new files added
expecting success of 9300.59 'H: verify file':
echo "$file5_data" >expect &&
git cat-file blob H:h/e/l/lo >actual &&
test_cmp expect actual
++ echo 'an inline file.
we should see it later.'
++ git cat-file blob H:h/e/l/lo
++ test_cmp expect actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual
ok 59 - H: verify file
expecting success of 9300.60 'I: export-pack-edges':
cat >input <<-INPUT_END &&
commit refs/heads/export-boundary
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
we have a border. its only 40 characters wide.
COMMIT
from refs/heads/branch
INPUT_END
git fast-import --export-pack-edges=edges.list <input
++ cat
++ git fast-import --export-pack-edges=edges.list
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 1 ( 0 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 0 ( 0 duplicates 0 deltas of 0 attempts)
commits: 1 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 3
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 4
pack_report: pack_mmap_calls = 3
pack_report: pack_open_windows = 3 / 3
pack_report: pack_mapped = 858 / 858
---------------------------------------------------------------------
ok 60 - I: export-pack-edges
expecting success of 9300.61 'I: verify edge list':
cat >expect <<-EOF &&
.git/objects/pack/pack-.pack: $(git rev-parse --verify export-boundary)
EOF
sed -e s/pack-.*pack/pack-.pack/ edges.list >actual &&
test_cmp expect actual
++ cat
+++ git rev-parse --verify export-boundary
++ sed -e 's/pack-.*pack/pack-.pack/' edges.list
++ test_cmp expect actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual
ok 61 - I: verify edge list
expecting success of 9300.62 'J: reset existing branch creates empty commit':
cat >input <<-INPUT_END &&
commit refs/heads/J
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
create J
COMMIT
from refs/heads/branch
reset refs/heads/J
commit refs/heads/J
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
initialize J
COMMIT
INPUT_END
git fast-import <input
++ cat
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 3 ( 0 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 1 ( 0 duplicates 0 deltas of 0 attempts)
commits: 2 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 3
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 4
pack_report: pack_mmap_calls = 3
pack_report: pack_open_windows = 3 / 3
pack_report: pack_mapped = 965 / 965
---------------------------------------------------------------------
ok 62 - J: reset existing branch creates empty commit
expecting success of 9300.63 'J: branch has 1 commit, empty tree':
test 1 = $(git rev-list J | wc -l) &&
test 0 = $(git ls-tree J | wc -l)
+++ git rev-list J
+++ wc -l
++ test 1 = 1
+++ git ls-tree J
+++ wc -l
++ test 0 = 0
ok 63 - J: branch has 1 commit, empty tree
expecting success of 9300.64 'J: tag must fail on empty branch':
cat >input <<-INPUT_END &&
reset refs/heads/J2
tag wrong_tag
from refs/heads/J2
data <<EOF
Tag branch that was reset.
EOF
INPUT_END
test_must_fail git fast-import <input
++ cat
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
fatal: Can't tag an empty branch.
fast-import: dumping crash report to .git/fast_import_crash_1943697
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
ok 64 - J: tag must fail on empty branch
expecting success of 9300.65 'K: reinit branch with from':
cat >input <<-INPUT_END &&
commit refs/heads/K
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
create K
COMMIT
from refs/heads/branch
commit refs/heads/K
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
redo K
COMMIT
from refs/heads/branch^1
INPUT_END
git fast-import <input
++ cat
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 2 ( 0 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 0 ( 0 duplicates 0 deltas of 0 attempts)
commits: 2 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 3
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 7
pack_report: pack_mmap_calls = 3
pack_report: pack_open_windows = 3 / 3
pack_report: pack_mapped = 978 / 978
---------------------------------------------------------------------
ok 65 - K: reinit branch with from
expecting success of 9300.66 'K: verify K^1 = branch^1':
test $(git rev-parse --verify branch^1) \
= $(git rev-parse --verify K^1)
+++ git rev-parse --verify 'branch^1'
+++ git rev-parse --verify 'K^1'
++ test f3aa51c819f0b3cc0ee594d10afaf6c84d7da579 = f3aa51c819f0b3cc0ee594d10afaf6c84d7da579
ok 66 - K: verify K^1 = branch^1
expecting success of 9300.67 'L: verify internal tree sorting':
cat >input <<-INPUT_END &&
blob
mark :1
data <<EOF
some data
EOF
blob
mark :2
data <<EOF
other data
EOF
commit refs/heads/L
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
create L
COMMIT
M 644 :1 b.
M 644 :1 b/other
M 644 :1 ba
commit refs/heads/L
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
update L
COMMIT
M 644 :2 b.
M 644 :2 b/other
M 644 :2 ba
INPUT_END
cat >expect <<-EXPECT_END &&
:100644 100644 M b.
:040000 040000 M b
:100644 100644 M ba
EXPECT_END
git -c core.protectNTFS=false fast-import <input &&
GIT_PRINT_SHA1_ELLIPSIS="yes" git diff-tree --abbrev --raw L^ L >output &&
cut -d" " -f1,2,5 output >actual &&
test_cmp expect actual
++ cat
++ cat
++ git -c core.protectNTFS=false fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 8 ( 0 duplicates )
blobs : 2 ( 0 duplicates 0 deltas of 0 attempts)
trees : 4 ( 0 duplicates 0 deltas of 2 attempts)
commits: 2 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 2 unique )
atoms: 4
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 2
pack_report: pack_mmap_calls = 1
pack_report: pack_open_windows = 1 / 1
pack_report: pack_mapped = 581 / 581
---------------------------------------------------------------------
++ GIT_PRINT_SHA1_ELLIPSIS=yes
++ git diff-tree --abbrev --raw 'L^' L
++ cut '-d ' -f1,2,5 output
++ test_cmp expect actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual
ok 67 - L: verify internal tree sorting
expecting success of 9300.68 'L: nested tree copy does not corrupt deltas':
cat >input <<-INPUT_END &&
blob
mark :1
data <<EOF
the data
EOF
commit refs/heads/L2
committer C O Mitter <[email protected]> 1112912473 -0700
data <<COMMIT
init L2
COMMIT
M 644 :1 a/b/c
M 644 :1 a/b/d
M 644 :1 a/e/f
commit refs/heads/L2
committer C O Mitter <[email protected]> 1112912473 -0700
data <<COMMIT
update L2
COMMIT
C a g
C a/e g/b
M 644 :1 g/b/h
INPUT_END
cat >expect <<-\EOF &&
g/b/f
g/b/h
EOF
test_when_finished "git update-ref -d refs/heads/L2" &&
git fast-import <input &&
git ls-tree L2 g/b/ >tmp &&
cut -f 2 <tmp >actual &&
test_cmp expect actual &&
git fsck $(git rev-parse L2)
++ cat
++ cat
++ test_when_finished 'git update-ref -d refs/heads/L2'
++ test 0 = 0
++ test_cleanup='{ git update-ref -d refs/heads/L2
} && (exit "$eval_ret"); eval_ret=$?; :'
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 10 ( 0 duplicates )
blobs : 1 ( 0 duplicates 0 deltas of 0 attempts)
trees : 7 ( 0 duplicates 1 deltas of 1 attempts)
commits: 2 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 1 unique )
atoms: 8
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 4
pack_report: pack_mmap_calls = 2
pack_report: pack_open_windows = 1 / 1
pack_report: pack_mapped = 668 / 668
---------------------------------------------------------------------
++ git ls-tree L2 g/b/
++ cut -f 2
++ test_cmp expect actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual
+++ git rev-parse L2
++ git fsck a924c963de6f5db73e8897b34c73cdf0b320344b
Checking ref database: 100% (1/1), done.
Checking object directories: 100% (256/256), done.
warning in tag 0e22025f0f5cea5d83b68c3dc9fc334571f7196c: missingTaggerEntry: invalid format - expected 'tagger' line
warning in tag 103553a16e02d76e288cec0f76240f1ad97caeb9: missingTaggerEntry: invalid format - expected 'tagger' line
warning in tag 42d861d649a1b87eb8083ad1d94d9220ecf2c35f: missingTaggerEntry: invalid format - expected 'tagger' line
warning in tag 3750af27267cae07dd3f8b7a9aac2291e374a66a: missingTaggerEntry: invalid format - expected 'tagger' line
warning in tag 56c14ce987117cf2e391ebef3dbab65e4c1ed202: missingTaggerEntry: invalid format - expected 'tagger' line
warning in tag e0764732957e237a858c7535fca3c2b966065dac: missingTaggerEntry: invalid format - expected 'tagger' line
Checking objects: 100% (63/63), done.
dangling blob 8436d07c4b682e3c824ffae4608920535091c4d0
dangling commit 8cecdab6b3e4062de5b06ad3accf5bff1449e99b
dangling tag 0e22025f0f5cea5d83b68c3dc9fc334571f7196c
dangling commit 0f211fb139642df301c0d0ceedd2021012d4dd8d
dangling tag 103553a16e02d76e288cec0f76240f1ad97caeb9
dangling commit 8c1bf1b9f891df8805c27a54986e5043829939ad
dangling commit 994b824fbe51b899f546383c3ba14a28a07c1022
dangling commit a53846236402ec769ea7f2fd7632de38e28f3273
dangling commit ac2b62088fe0283163c00fa7856bcd0489cf30de
dangling tag 3750af27267cae07dd3f8b7a9aac2291e374a66a
dangling commit 45b12606bd487d1bc687864db7641b9bfd4ddcd0
dangling commit c85b9f480bbc2f7616de78fc96c08204e0f5b70e
dangling tag 42d861d649a1b87eb8083ad1d94d9220ecf2c35f
dangling tag 56c14ce987117cf2e391ebef3dbab65e4c1ed202
dangling commit d892dc32fa7a52ea3a397cfc4449e9df8a39becf
dangling commit 5cdb3613534ced7561d4baa9c18f92e6f446501c
dangling commit de5766c434bb93360ee19879605fe31f25cdcf20
dangling commit 6b33e55cd592e91710d6c0afef1b0e6e3406a2a7
dangling commit fb7baf16109664b6b1d3b3c98d6c252fa7051ae5
Verifying commits in commit graph: 100% (4/4), done.
++ git update-ref -d refs/heads/L2
++ exit 0
++ eval_ret=0
++ :
ok 68 - L: nested tree copy does not corrupt deltas
expecting success of 9300.69 'M: rename file in same subdirectory':
test_tick &&
cat >input <<-INPUT_END &&
commit refs/heads/M1
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
file rename
COMMIT
from refs/heads/branch^0
R file2/newf file2/n.e.w.f
INPUT_END
cat >expect <<-EOF &&
:100755 100755 $newf $newf R100 file2/newf file2/n.e.w.f
EOF
git fast-import <input &&
git diff-tree -M -r M1^ M1 >actual &&
compare_diff_raw expect actual
++ test_tick
++ test -z set
++ test_tick=1112912593
++ GIT_COMMITTER_DATE='1112912593 -0700'
++ GIT_AUTHOR_DATE='1112912593 -0700'
++ export GIT_COMMITTER_DATE GIT_AUTHOR_DATE
++ cat
++ cat
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 3 ( 0 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 2 ( 0 duplicates 0 deltas of 0 attempts)
commits: 1 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 6
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 7
pack_report: pack_mmap_calls = 4
pack_report: pack_open_windows = 4 / 4
pack_report: pack_mapped = 1348 / 1348
---------------------------------------------------------------------
++ git diff-tree -M -r 'M1^' M1
++ compare_diff_raw expect actual
++ sed -e '/^:/s/ \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([A-Z]\)[0-9]* / \1 \2 \3# /'
++ sed -e '/^:/s/ \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([A-Z]\)[0-9]* / \1 \2 \3# /'
++ test_cmp .tmp-1 .tmp-2
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u .tmp-1 .tmp-2
++ rm -f .tmp-1 .tmp-2
ok 69 - M: rename file in same subdirectory
expecting success of 9300.70 'M: rename file to new subdirectory':
cat >input <<-INPUT_END &&
commit refs/heads/M2
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
file rename
COMMIT
from refs/heads/branch^0
R file2/newf i/am/new/to/you
INPUT_END
cat >expect <<-EOF &&
:100755 100755 $newf $newf R100 file2/newf i/am/new/to/you
EOF
git fast-import <input &&
git diff-tree -M -r M2^ M2 >actual &&
compare_diff_raw expect actual
++ cat
++ cat
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 7 ( 0 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 6 ( 0 duplicates 0 deltas of 0 attempts)
commits: 1 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 10
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 7
pack_report: pack_mmap_calls = 4
pack_report: pack_open_windows = 4 / 4
pack_report: pack_mapped = 1498 / 1498
---------------------------------------------------------------------
++ git diff-tree -M -r 'M2^' M2
++ compare_diff_raw expect actual
++ sed -e '/^:/s/ \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([A-Z]\)[0-9]* / \1 \2 \3# /'
++ sed -e '/^:/s/ \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([A-Z]\)[0-9]* / \1 \2 \3# /'
++ test_cmp .tmp-1 .tmp-2
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u .tmp-1 .tmp-2
++ rm -f .tmp-1 .tmp-2
ok 70 - M: rename file to new subdirectory
expecting success of 9300.71 'M: rename subdirectory to new subdirectory':
cat >input <<-INPUT_END &&
commit refs/heads/M3
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
file rename
COMMIT
from refs/heads/M2^0
R i other/sub
INPUT_END
cat >expect <<-EOF &&
:100755 100755 $newf $newf R100 i/am/new/to/you other/sub/am/new/to/you
EOF
git fast-import <input &&
git diff-tree -M -r M3^ M3 >actual &&
compare_diff_raw expect actual
++ cat
++ cat
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 3 ( 0 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 2 ( 0 duplicates 0 deltas of 0 attempts)
commits: 1 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 6
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 6
pack_report: pack_mmap_calls = 2
pack_report: pack_open_windows = 2 / 2
pack_report: pack_mapped = 877 / 877
---------------------------------------------------------------------
++ git diff-tree -M -r 'M3^' M3
++ compare_diff_raw expect actual
++ sed -e '/^:/s/ \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([A-Z]\)[0-9]* / \1 \2 \3# /'
++ sed -e '/^:/s/ \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([A-Z]\)[0-9]* / \1 \2 \3# /'
++ test_cmp .tmp-1 .tmp-2
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u .tmp-1 .tmp-2
++ rm -f .tmp-1 .tmp-2
ok 71 - M: rename subdirectory to new subdirectory
expecting success of 9300.72 'M: rename root ("") to subdirectory':
cat >input <<-INPUT_END &&
commit refs/heads/M4
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
rename root
COMMIT
from refs/heads/M2^0
R $root sub
INPUT_END
cat >expect <<-EOF &&
:100644 100644 $oldf $oldf R100 file2/oldf sub/file2/oldf
:100755 100755 $f4id $f4id R100 file4 sub/file4
:100755 100755 $newf $newf R100 i/am/new/to/you sub/i/am/new/to/you
:100755 100755 $f6id $f6id R100 newdir/exec.sh sub/newdir/exec.sh
:100644 100644 $f5id $f5id R100 newdir/interesting sub/newdir/interesting
EOF
git fast-import <input &&
git diff-tree -M -r M4^ M4 >actual &&
compare_diff_raw expect actual
++ cat
++ cat
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 2 ( 0 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 1 ( 0 duplicates 0 deltas of 0 attempts)
commits: 1 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 5
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 6
pack_report: pack_mmap_calls = 2
pack_report: pack_open_windows = 2 / 2
pack_report: pack_mapped = 742 / 742
---------------------------------------------------------------------
++ git diff-tree -M -r 'M4^' M4
++ compare_diff_raw expect actual
++ sed -e '/^:/s/ \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([A-Z]\)[0-9]* / \1 \2 \3# /'
++ sed -e '/^:/s/ \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([A-Z]\)[0-9]* / \1 \2 \3# /'
++ test_cmp .tmp-1 .tmp-2
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u .tmp-1 .tmp-2
++ rm -f .tmp-1 .tmp-2
ok 72 - M: rename root ("") to subdirectory
expecting success of 9300.73 'M: rename root () to subdirectory':
cat >input <<-INPUT_END &&
commit refs/heads/M4
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
rename root
COMMIT
from refs/heads/M2^0
R $root sub
INPUT_END
cat >expect <<-EOF &&
:100644 100644 $oldf $oldf R100 file2/oldf sub/file2/oldf
:100755 100755 $f4id $f4id R100 file4 sub/file4
:100755 100755 $newf $newf R100 i/am/new/to/you sub/i/am/new/to/you
:100755 100755 $f6id $f6id R100 newdir/exec.sh sub/newdir/exec.sh
:100644 100644 $f5id $f5id R100 newdir/interesting sub/newdir/interesting
EOF
git fast-import <input &&
git diff-tree -M -r M4^ M4 >actual &&
compare_diff_raw expect actual
++ cat
++ cat
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 0 ( 2 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 0 ( 1 duplicates 0 deltas of 0 attempts)
commits: 0 ( 1 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 5
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 6
pack_report: pack_mmap_calls = 2
pack_report: pack_open_windows = 2 / 2
pack_report: pack_mapped = 742 / 742
---------------------------------------------------------------------
++ git diff-tree -M -r 'M4^' M4
++ compare_diff_raw expect actual
++ sed -e '/^:/s/ \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([A-Z]\)[0-9]* / \1 \2 \3# /'
++ sed -e '/^:/s/ \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([A-Z]\)[0-9]* / \1 \2 \3# /'
++ test_cmp .tmp-1 .tmp-2
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u .tmp-1 .tmp-2
++ rm -f .tmp-1 .tmp-2
ok 73 - M: rename root () to subdirectory
expecting success of 9300.74 'N: copy file in same subdirectory':
test_tick &&
cat >input <<-INPUT_END &&
commit refs/heads/N1
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
file copy
COMMIT
from refs/heads/branch^0
C file2/newf file2/n.e.w.f
INPUT_END
cat >expect <<-EOF &&
:100755 100755 $newf $newf C100 file2/newf file2/n.e.w.f
EOF
git fast-import <input &&
git diff-tree -C --find-copies-harder -r N1^ N1 >actual &&
compare_diff_raw expect actual
++ test_tick
++ test -z set
++ test_tick=1112912653
++ GIT_COMMITTER_DATE='1112912653 -0700'
++ GIT_AUTHOR_DATE='1112912653 -0700'
++ export GIT_COMMITTER_DATE GIT_AUTHOR_DATE
++ cat
++ cat
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 3 ( 0 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 2 ( 0 duplicates 0 deltas of 0 attempts)
commits: 1 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 6
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 7
pack_report: pack_mmap_calls = 4
pack_report: pack_open_windows = 4 / 4
pack_report: pack_mapped = 1349 / 1349
---------------------------------------------------------------------
++ git diff-tree -C --find-copies-harder -r 'N1^' N1
++ compare_diff_raw expect actual
++ sed -e '/^:/s/ \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([A-Z]\)[0-9]* / \1 \2 \3# /'
++ sed -e '/^:/s/ \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([A-Z]\)[0-9]* / \1 \2 \3# /'
++ test_cmp .tmp-1 .tmp-2
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u .tmp-1 .tmp-2
++ rm -f .tmp-1 .tmp-2
ok 74 - N: copy file in same subdirectory
expecting success of 9300.75 'N: copy then modify subdirectory':
cat >input <<-INPUT_END &&
commit refs/heads/N2
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
clean directory copy
COMMIT
from refs/heads/branch^0
C file2 file3
commit refs/heads/N2
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
modify directory copy
COMMIT
M 644 inline file3/file5
data <<EOF
$file5_data
EOF
INPUT_END
cat >expect <<-EOF &&
:100644 100644 $f5id $f5id C100 newdir/interesting file3/file5
:100755 100755 $newf $newf C100 file2/newf file3/newf
:100644 100644 $oldf $oldf C100 file2/oldf file3/oldf
EOF
git fast-import <input &&
git diff-tree -C --find-copies-harder -r N2^^ N2 >actual &&
compare_diff_raw expect actual
++ cat
++ cat
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 5 ( 1 duplicates )
blobs : 0 ( 1 duplicates 0 deltas of 0 attempts)
trees : 3 ( 0 duplicates 1 deltas of 1 attempts)
commits: 2 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 7
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 7
pack_report: pack_mmap_calls = 4
pack_report: pack_open_windows = 4 / 4
pack_report: pack_mapped = 1589 / 1589
---------------------------------------------------------------------
++ git diff-tree -C --find-copies-harder -r 'N2^^' N2
++ compare_diff_raw expect actual
++ sed -e '/^:/s/ \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([A-Z]\)[0-9]* / \1 \2 \3# /'
++ sed -e '/^:/s/ \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([A-Z]\)[0-9]* / \1 \2 \3# /'
++ test_cmp .tmp-1 .tmp-2
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u .tmp-1 .tmp-2
++ rm -f .tmp-1 .tmp-2
ok 75 - N: copy then modify subdirectory
expecting success of 9300.76 'N: copy dirty subdirectory':
cat >input <<-INPUT_END &&
commit refs/heads/N3
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
dirty directory copy
COMMIT
from refs/heads/branch^0
M 644 inline file2/file5
data <<EOF
$file5_data
EOF
C file2 file3
D file2/file5
INPUT_END
git fast-import <input &&
test $(git rev-parse N2^{tree}) = $(git rev-parse N3^{tree})
++ cat
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 1 ( 4 duplicates )
blobs : 0 ( 1 duplicates 0 deltas of 0 attempts)
trees : 0 ( 3 duplicates 0 deltas of 0 attempts)
commits: 1 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 7
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 7
pack_report: pack_mmap_calls = 4
pack_report: pack_open_windows = 4 / 4
pack_report: pack_mapped = 1170 / 1170
---------------------------------------------------------------------
+++ git rev-parse 'N2^{tree}'
+++ git rev-parse 'N3^{tree}'
++ test b0cde842a20980d0267bba47c476c1c42e8781c2 = b0cde842a20980d0267bba47c476c1c42e8781c2
ok 76 - N: copy dirty subdirectory
expecting success of 9300.77 'N: copy directory by id':
cat >expect <<-EOF &&
:100755 100755 $newf $newf C100 file2/newf file3/newf
:100644 100644 $oldf $oldf C100 file2/oldf file3/oldf
EOF
subdir=$(git rev-parse refs/heads/branch^0:file2) &&
cat >input <<-INPUT_END &&
commit refs/heads/N4
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
copy by tree hash
COMMIT
from refs/heads/branch^0
M 040000 $subdir file3
INPUT_END
git fast-import <input &&
git diff-tree -C --find-copies-harder -r N4^ N4 >actual &&
compare_diff_raw expect actual
++ cat
+++ git rev-parse 'refs/heads/branch^0:file2'
++ subdir=a1a2d79cb371343544a4955c8ecbf2185f06a930
++ cat
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 1 ( 1 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 0 ( 1 duplicates 0 deltas of 0 attempts)
commits: 1 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 4
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 7
pack_report: pack_mmap_calls = 4
pack_report: pack_open_windows = 4 / 4
pack_report: pack_mapped = 1169 / 1169
---------------------------------------------------------------------
++ git diff-tree -C --find-copies-harder -r 'N4^' N4
++ compare_diff_raw expect actual
++ sed -e '/^:/s/ \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([A-Z]\)[0-9]* / \1 \2 \3# /'
++ sed -e '/^:/s/ \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([A-Z]\)[0-9]* / \1 \2 \3# /'
++ test_cmp .tmp-1 .tmp-2
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u .tmp-1 .tmp-2
++ rm -f .tmp-1 .tmp-2
ok 77 - N: copy directory by id
checking prerequisite: PIPE
mkdir -p "$TRASH_DIRECTORY/prereq-test-dir-PIPE" &&
(
cd "$TRASH_DIRECTORY/prereq-test-dir-PIPE" &&
# test whether the filesystem supports FIFOs
test_have_prereq !MINGW,!CYGWIN &&
rm -f testfifo && mkfifo testfifo
)
++ mkdir -p '/var/tmp/b/git/t/trash directory.t9300-fast-import/prereq-test-dir-PIPE'
++ cd '/var/tmp/b/git/t/trash directory.t9300-fast-import/prereq-test-dir-PIPE'
++ test_have_prereq '!MINGW,!CYGWIN'
++ save_IFS='
'
++ IFS=,
++ set -- '!MINGW' '!CYGWIN'
++ IFS='
'
++ total_prereq=0
++ ok_prereq=0
++ missing_prereq=
++ for prerequisite in "$@"
++ case "$prerequisite" in
++ negative_prereq=t
++ prerequisite=MINGW
++ case " $lazily_tested_prereq " in
++ case " $lazily_testable_prereq " in
++ total_prereq=1
++ case "$satisfied_prereq" in
++ satisfied_this_prereq=
++ case "$satisfied_this_prereq,$negative_prereq" in
++ ok_prereq=1
++ for prerequisite in "$@"
++ case "$prerequisite" in
++ negative_prereq=t
++ prerequisite=CYGWIN
++ case " $lazily_tested_prereq " in
++ case " $lazily_testable_prereq " in
++ total_prereq=2
++ case "$satisfied_prereq" in
++ satisfied_this_prereq=
++ case "$satisfied_this_prereq,$negative_prereq" in
++ ok_prereq=2
++ test 2 = 2
++ rm -f testfifo
++ mkfifo testfifo
prerequisite PIPE ok
expecting success of 9300.78 'N: read and copy directory':
cat >expect <<-EOF &&
:100755 100755 $newf $newf C100 file2/newf file3/newf
:100644 100644 $oldf $oldf C100 file2/oldf file3/oldf
EOF
git update-ref -d refs/heads/N4 &&
rm -f backflow &&
mkfifo backflow &&
(
exec <backflow &&
cat <<-EOF &&
commit refs/heads/N4
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
copy by tree hash, part 2
COMMIT
from refs/heads/branch^0
ls "file2"
EOF
read mode type tree filename &&
echo "M 040000 $tree file3"
) |
git fast-import --cat-blob-fd=3 3>backflow &&
git diff-tree -C --find-copies-harder -r N4^ N4 >actual &&
compare_diff_raw expect actual
++ cat
++ git update-ref -d refs/heads/N4
++ rm -f backflow
++ mkfifo backflow
++ git fast-import --cat-blob-fd=3
++ exec
++ cat
++ read mode type tree filename
++ echo 'M 040000 a1a2d79cb371343544a4955c8ecbf2185f06a930 file3'
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 1 ( 1 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 0 ( 1 duplicates 0 deltas of 0 attempts)
commits: 1 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 4
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 7
pack_report: pack_mmap_calls = 4
pack_report: pack_open_windows = 4 / 4
pack_report: pack_mapped = 1175 / 1175
---------------------------------------------------------------------
++ git diff-tree -C --find-copies-harder -r 'N4^' N4
++ compare_diff_raw expect actual
++ sed -e '/^:/s/ \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([A-Z]\)[0-9]* / \1 \2 \3# /'
++ sed -e '/^:/s/ \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([A-Z]\)[0-9]* / \1 \2 \3# /'
++ test_cmp .tmp-1 .tmp-2
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u .tmp-1 .tmp-2
++ rm -f .tmp-1 .tmp-2
ok 78 - N: read and copy directory
expecting success of 9300.79 'N: empty directory reads as missing':
cat <<-\EOF >expect &&
OBJNAME
:000000 100644 OBJNAME OBJNAME A unrelated
EOF
echo "missing src" >expect.response &&
git update-ref -d refs/heads/read-empty &&
rm -f backflow &&
mkfifo backflow &&
(
exec <backflow &&
cat <<-EOF &&
commit refs/heads/read-empty
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
read "empty" (missing) directory
COMMIT
M 100644 inline src/greeting
data <<BLOB
hello
BLOB
C src/greeting dst1/non-greeting
C src/greeting unrelated
# leave behind "empty" src directory
D src/greeting
ls "src"
EOF
read -r line &&
printf "%s\n" "$line" >response &&
cat <<-\EOF
D dst1
D dst2
EOF
) |
git fast-import --cat-blob-fd=3 3>backflow &&
test_cmp expect.response response &&
git rev-list read-empty |
git diff-tree -r --root --stdin |
sed "s/$OID_REGEX/OBJNAME/g" >actual &&
test_cmp expect actual
++ cat
++ echo 'missing src'
++ git update-ref -d refs/heads/read-empty
++ rm -f backflow
++ mkfifo backflow
++ exec
++ git fast-import --cat-blob-fd=3
++ cat
++ read -r line
++ printf '%s\n' 'missing src'
++ cat
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 3 ( 0 duplicates )
blobs : 1 ( 0 duplicates 0 deltas of 0 attempts)
trees : 1 ( 0 duplicates 0 deltas of 0 attempts)
commits: 1 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 5
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 2
pack_report: pack_mmap_calls = 1
pack_report: pack_open_windows = 1 / 1
pack_report: pack_mapped = 236 / 236
---------------------------------------------------------------------
++ test_cmp expect.response response
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect.response response
++ git diff-tree -r --root --stdin
++ git rev-list read-empty
++ sed 's/[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]/OBJNAME/g'
++ test_cmp expect actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual
ok 79 - N: empty directory reads as missing
expecting success of 9300.80 'N: copy root ("") by tree hash':
cat >expect <<-EOF &&
:100755 000000 $newf $zero D file3/newf
:100644 000000 $oldf $zero D file3/oldf
EOF
root_tree=$(git rev-parse refs/heads/branch^0^{tree}) &&
cat >input <<-INPUT_END &&
commit refs/heads/N6
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
copy root directory by tree hash
COMMIT
from refs/heads/branch^0
M 040000 $root_tree $root
INPUT_END
git fast-import <input &&
git diff-tree -C --find-copies-harder -r N4 N6 >actual &&
compare_diff_raw expect actual
++ cat
+++ git rev-parse 'refs/heads/branch^0^{tree}'
++ root_tree=8be2429e4b59e11149f8c84d6095f73828a99557
++ cat
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 1 ( 0 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 0 ( 0 duplicates 0 deltas of 0 attempts)
commits: 1 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 3
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 7
pack_report: pack_mmap_calls = 3
pack_report: pack_open_windows = 3 / 3
pack_report: pack_mapped = 845 / 845
---------------------------------------------------------------------
++ git diff-tree -C --find-copies-harder -r N4 N6
++ compare_diff_raw expect actual
++ sed -e '/^:/s/ \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([A-Z]\)[0-9]* / \1 \2 \3# /'
++ sed -e '/^:/s/ \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([A-Z]\)[0-9]* / \1 \2 \3# /'
++ test_cmp .tmp-1 .tmp-2
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u .tmp-1 .tmp-2
++ rm -f .tmp-1 .tmp-2
ok 80 - N: copy root ("") by tree hash
expecting success of 9300.81 'N: copy root ("") by path':
cat >expect <<-EOF &&
:100755 100755 $newf $newf C100 file2/newf oldroot/file2/newf
:100644 100644 $oldf $oldf C100 file2/oldf oldroot/file2/oldf
:100755 100755 $f4id $f4id C100 file4 oldroot/file4
:100755 100755 $f6id $f6id C100 newdir/exec.sh oldroot/newdir/exec.sh
:100644 100644 $f5id $f5id C100 newdir/interesting oldroot/newdir/interesting
EOF
cat >input <<-INPUT_END &&
commit refs/heads/N-copy-root-path
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
copy root directory by (empty) path
COMMIT
from refs/heads/branch^0
C $root oldroot
INPUT_END
git fast-import <input &&
git diff-tree -C --find-copies-harder -r branch N-copy-root-path >actual &&
compare_diff_raw expect actual
++ cat
++ cat
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 2 ( 0 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 1 ( 0 duplicates 0 deltas of 0 attempts)
commits: 1 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 4
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 6
pack_report: pack_mmap_calls = 3
pack_report: pack_open_windows = 3 / 3
pack_report: pack_mapped = 985 / 985
---------------------------------------------------------------------
++ git diff-tree -C --find-copies-harder -r branch N-copy-root-path
++ compare_diff_raw expect actual
++ sed -e '/^:/s/ \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([A-Z]\)[0-9]* / \1 \2 \3# /'
++ sed -e '/^:/s/ \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([A-Z]\)[0-9]* / \1 \2 \3# /'
++ test_cmp .tmp-1 .tmp-2
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u .tmp-1 .tmp-2
++ rm -f .tmp-1 .tmp-2
ok 81 - N: copy root ("") by path
expecting success of 9300.82 'N: copy root () by tree hash':
cat >expect <<-EOF &&
:100755 000000 $newf $zero D file3/newf
:100644 000000 $oldf $zero D file3/oldf
EOF
root_tree=$(git rev-parse refs/heads/branch^0^{tree}) &&
cat >input <<-INPUT_END &&
commit refs/heads/N6
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
copy root directory by tree hash
COMMIT
from refs/heads/branch^0
M 040000 $root_tree $root
INPUT_END
git fast-import <input &&
git diff-tree -C --find-copies-harder -r N4 N6 >actual &&
compare_diff_raw expect actual
++ cat
+++ git rev-parse 'refs/heads/branch^0^{tree}'
++ root_tree=8be2429e4b59e11149f8c84d6095f73828a99557
++ cat
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 0 ( 1 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 0 ( 0 duplicates 0 deltas of 0 attempts)
commits: 0 ( 1 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 3
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 7
pack_report: pack_mmap_calls = 3
pack_report: pack_open_windows = 3 / 3
pack_report: pack_mapped = 845 / 845
---------------------------------------------------------------------
++ git diff-tree -C --find-copies-harder -r N4 N6
++ compare_diff_raw expect actual
++ sed -e '/^:/s/ \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([A-Z]\)[0-9]* / \1 \2 \3# /'
++ sed -e '/^:/s/ \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([A-Z]\)[0-9]* / \1 \2 \3# /'
++ test_cmp .tmp-1 .tmp-2
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u .tmp-1 .tmp-2
++ rm -f .tmp-1 .tmp-2
ok 82 - N: copy root () by tree hash
expecting success of 9300.83 'N: copy root () by path':
cat >expect <<-EOF &&
:100755 100755 $newf $newf C100 file2/newf oldroot/file2/newf
:100644 100644 $oldf $oldf C100 file2/oldf oldroot/file2/oldf
:100755 100755 $f4id $f4id C100 file4 oldroot/file4
:100755 100755 $f6id $f6id C100 newdir/exec.sh oldroot/newdir/exec.sh
:100644 100644 $f5id $f5id C100 newdir/interesting oldroot/newdir/interesting
EOF
cat >input <<-INPUT_END &&
commit refs/heads/N-copy-root-path
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
copy root directory by (empty) path
COMMIT
from refs/heads/branch^0
C $root oldroot
INPUT_END
git fast-import <input &&
git diff-tree -C --find-copies-harder -r branch N-copy-root-path >actual &&
compare_diff_raw expect actual
++ cat
++ cat
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 0 ( 2 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 0 ( 1 duplicates 0 deltas of 0 attempts)
commits: 0 ( 1 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 4
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 6
pack_report: pack_mmap_calls = 3
pack_report: pack_open_windows = 3 / 3
pack_report: pack_mapped = 985 / 985
---------------------------------------------------------------------
++ git diff-tree -C --find-copies-harder -r branch N-copy-root-path
++ compare_diff_raw expect actual
++ sed -e '/^:/s/ \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([A-Z]\)[0-9]* / \1 \2 \3# /'
++ sed -e '/^:/s/ \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([A-Z]\)[0-9]* / \1 \2 \3# /'
++ test_cmp .tmp-1 .tmp-2
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u .tmp-1 .tmp-2
++ rm -f .tmp-1 .tmp-2
ok 83 - N: copy root () by path
expecting success of 9300.84 'N: delete directory by copying':
cat >expect <<-\EOF &&
OBJID
:100644 000000 OBJID OBJID D foo/bar/qux
OBJID
:000000 100644 OBJID OBJID A foo/bar/baz
:000000 100644 OBJID OBJID A foo/bar/qux
EOF
empty_tree=$(git mktree </dev/null) &&
cat >input <<-INPUT_END &&
commit refs/heads/N-delete
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
collect data to be deleted
COMMIT
deleteall
M 100644 inline foo/bar/baz
data <<DATA_END
hello
DATA_END
C "foo/bar/baz" "foo/bar/qux"
C "foo/bar/baz" "foo/bar/quux/1"
C "foo/bar/baz" "foo/bar/quuux"
M 040000 $empty_tree foo/bar/quux
M 040000 $empty_tree foo/bar/quuux
commit refs/heads/N-delete
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
delete subdirectory
COMMIT
M 040000 $empty_tree foo/bar/qux
INPUT_END
git fast-import <input &&
git rev-list N-delete |
git diff-tree -r --stdin --root --always |
sed -e "s/$OID_REGEX/OBJID/g" >actual &&
test_cmp expect actual
++ cat
+++ git mktree
++ empty_tree=4b825dc642cb6eb9a060e54bf8d69288fbee4904
++ cat
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 8 ( 1 duplicates )
blobs : 0 ( 1 duplicates 0 deltas of 0 attempts)
trees : 6 ( 0 duplicates 1 deltas of 3 attempts)
commits: 2 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 7
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 2
pack_report: pack_mmap_calls = 1
pack_report: pack_open_windows = 1 / 1
pack_report: pack_mapped = 549 / 549
---------------------------------------------------------------------
++ git rev-list N-delete
++ git diff-tree -r --stdin --root --always
++ sed -e 's/[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]/OBJID/g'
++ test_cmp expect actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual
ok 84 - N: delete directory by copying
expecting success of 9300.85 'N: modify copied tree':
cat >expect <<-EOF &&
:100644 100644 $f5id $f5id C100 newdir/interesting file3/file5
:100755 100755 $newf $newf C100 file2/newf file3/newf
:100644 100644 $oldf $oldf C100 file2/oldf file3/oldf
EOF
subdir=$(git rev-parse refs/heads/branch^0:file2) &&
cat >input <<-INPUT_END &&
commit refs/heads/N5
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
copy by tree hash
COMMIT
from refs/heads/branch^0
M 040000 $subdir file3
commit refs/heads/N5
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
modify directory copy
COMMIT
M 644 inline file3/file5
data <<EOF
$file5_data
EOF
INPUT_END
git fast-import <input &&
git diff-tree -C --find-copies-harder -r N5^^ N5 >actual &&
compare_diff_raw expect actual
++ cat
+++ git rev-parse 'refs/heads/branch^0:file2'
++ subdir=a1a2d79cb371343544a4955c8ecbf2185f06a930
++ cat
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 1 ( 5 duplicates )
blobs : 0 ( 1 duplicates 0 deltas of 0 attempts)
trees : 0 ( 3 duplicates 0 deltas of 0 attempts)
commits: 1 ( 1 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 7
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 8
pack_report: pack_mmap_calls = 4
pack_report: pack_open_windows = 4 / 4
pack_report: pack_mapped = 1172 / 1172
---------------------------------------------------------------------
++ git diff-tree -C --find-copies-harder -r 'N5^^' N5
++ compare_diff_raw expect actual
++ sed -e '/^:/s/ \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([A-Z]\)[0-9]* / \1 \2 \3# /'
++ sed -e '/^:/s/ \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([A-Z]\)[0-9]* / \1 \2 \3# /'
++ test_cmp .tmp-1 .tmp-2
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u .tmp-1 .tmp-2
++ rm -f .tmp-1 .tmp-2
ok 85 - N: modify copied tree
expecting success of 9300.86 'N: reject foo/ syntax':
subdir=$(git rev-parse refs/heads/branch^0:file2) &&
test_must_fail git fast-import <<-INPUT_END
commit refs/heads/N5B
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
copy with invalid syntax
COMMIT
from refs/heads/branch^0
M 040000 $subdir file3/
INPUT_END
+++ git rev-parse 'refs/heads/branch^0:file2'
++ subdir=a1a2d79cb371343544a4955c8ecbf2185f06a930
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
fatal: invalid path 'file3/'
fast-import: dumping crash report to .git/fast_import_crash_1943874
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
ok 86 - N: reject foo/ syntax
expecting success of 9300.87 'N: reject foo/ syntax in copy source':
test_must_fail git fast-import <<-INPUT_END
commit refs/heads/N5C
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
copy with invalid syntax
COMMIT
from refs/heads/branch^0
C file2/ file3
INPUT_END
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
fatal: Empty path component found in input
fast-import: dumping crash report to .git/fast_import_crash_1943875
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
ok 87 - N: reject foo/ syntax in copy source
expecting success of 9300.88 'N: reject foo/ syntax in rename source':
test_must_fail git fast-import <<-INPUT_END
commit refs/heads/N5D
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
rename with invalid syntax
COMMIT
from refs/heads/branch^0
R file2/ file3
INPUT_END
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
fatal: Path file2/ not in branch
fast-import: dumping crash report to .git/fast_import_crash_1943876
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
ok 88 - N: reject foo/ syntax in rename source
expecting success of 9300.89 'N: reject foo/ syntax in ls argument':
test_must_fail git fast-import <<-INPUT_END
commit refs/heads/N5E
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
copy with invalid syntax
COMMIT
from refs/heads/branch^0
ls "file2/"
INPUT_END
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
fatal: Empty path component found in input
fast-import: dumping crash report to .git/fast_import_crash_1943877
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
ok 89 - N: reject foo/ syntax in ls argument
expecting success of 9300.90 'N: copy to root ("") by id and modify':
echo "hello, world" >expect.foo &&
echo hello >expect.bar &&
git fast-import <<-SETUP_END &&
commit refs/heads/N7
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
hello, tree
COMMIT
deleteall
M 644 inline foo/bar
data <<EOF
hello
EOF
SETUP_END
tree=$(git rev-parse --verify N7:) &&
git fast-import <<-INPUT_END &&
commit refs/heads/N8
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
copy to root by id and modify
COMMIT
M 040000 $tree $root
M 644 inline foo/foo
data <<EOF
hello, world
EOF
INPUT_END
git show N8:foo/foo >actual.foo &&
git show N8:foo/bar >actual.bar &&
test_cmp expect.foo actual.foo &&
test_cmp expect.bar actual.bar
++ echo 'hello, world'
++ echo hello
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 3 ( 1 duplicates )
blobs : 0 ( 1 duplicates 0 deltas of 0 attempts)
trees : 2 ( 0 duplicates 0 deltas of 0 attempts)
commits: 1 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 2
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 2
pack_report: pack_mmap_calls = 1
pack_report: pack_open_windows = 1 / 1
pack_report: pack_mapped = 238 / 238
---------------------------------------------------------------------
+++ git rev-parse --verify N7:
++ tree=6ab387fae6bf9acb414e02264b09ec4b0c41adcc
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 4 ( 0 duplicates )
blobs : 1 ( 0 duplicates 0 deltas of 0 attempts)
trees : 2 ( 0 duplicates 0 deltas of 0 attempts)
commits: 1 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 2
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 5
pack_report: pack_mmap_calls = 2
pack_report: pack_open_windows = 2 / 2
pack_report: pack_mapped = 538 / 538
---------------------------------------------------------------------
++ git show N8:foo/foo
++ git show N8:foo/bar
++ test_cmp expect.foo actual.foo
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect.foo actual.foo
++ test_cmp expect.bar actual.bar
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect.bar actual.bar
ok 90 - N: copy to root ("") by id and modify
expecting success of 9300.91 'N: extract subtree to the root ("")':
branch=$(git rev-parse --verify refs/heads/branch^{tree}) &&
cat >input <<-INPUT_END &&
commit refs/heads/N9
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
extract subtree branch:newdir
COMMIT
M 040000 $branch $root
C "newdir" $root
INPUT_END
git fast-import <input &&
git diff --exit-code branch:newdir N9
+++ git rev-parse --verify 'refs/heads/branch^{tree}'
++ branch=8be2429e4b59e11149f8c84d6095f73828a99557
++ cat
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 1 ( 0 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 0 ( 0 duplicates 0 deltas of 0 attempts)
commits: 1 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 3
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 4
pack_report: pack_mmap_calls = 2
pack_report: pack_open_windows = 2 / 2
pack_report: pack_mapped = 621 / 621
---------------------------------------------------------------------
++ git diff --exit-code branch:newdir N9
ok 91 - N: extract subtree to the root ("")
expecting success of 9300.92 'N: modify subtree, extract it to the root (""), and modify again':
echo hello >expect.baz &&
echo hello, world >expect.qux &&
git fast-import <<-SETUP_END &&
commit refs/heads/N10
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
hello, tree
COMMIT
deleteall
M 644 inline foo/bar/baz
data <<EOF
hello
EOF
SETUP_END
tree=$(git rev-parse --verify N10:) &&
git fast-import <<-INPUT_END &&
commit refs/heads/N11
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
copy to root by id and modify
COMMIT
M 040000 $tree $root
M 100644 inline foo/bar/qux
data <<EOF
hello, world
EOF
R "foo" $root
C "bar/qux" "bar/quux"
INPUT_END
git show N11:bar/baz >actual.baz &&
git show N11:bar/qux >actual.qux &&
git show N11:bar/quux >actual.quux &&
test_cmp expect.baz actual.baz &&
test_cmp expect.qux actual.qux &&
test_cmp expect.qux actual.quux
++ echo hello
++ echo hello, world
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 1 ( 4 duplicates )
blobs : 0 ( 1 duplicates 0 deltas of 0 attempts)
trees : 0 ( 3 duplicates 0 deltas of 0 attempts)
commits: 1 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 3
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 2
pack_report: pack_mmap_calls = 1
pack_report: pack_open_windows = 1 / 1
pack_report: pack_mapped = 156 / 156
---------------------------------------------------------------------
+++ git rev-parse --verify N10:
++ tree=2542a3b2478a94f6dd2dae1a156e618a9d8bcda8
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 3 ( 1 duplicates )
blobs : 0 ( 1 duplicates 0 deltas of 0 attempts)
trees : 2 ( 0 duplicates 0 deltas of 0 attempts)
commits: 1 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 5
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 6
pack_report: pack_mmap_calls = 2
pack_report: pack_open_windows = 2 / 2
pack_report: pack_mapped = 833 / 833
---------------------------------------------------------------------
++ git show N11:bar/baz
++ git show N11:bar/qux
++ git show N11:bar/quux
++ test_cmp expect.baz actual.baz
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect.baz actual.baz
++ test_cmp expect.qux actual.qux
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect.qux actual.qux
++ test_cmp expect.qux actual.quux
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect.qux actual.quux
ok 92 - N: modify subtree, extract it to the root (""), and modify again
expecting success of 9300.93 'N: copy to root () by id and modify':
echo "hello, world" >expect.foo &&
echo hello >expect.bar &&
git fast-import <<-SETUP_END &&
commit refs/heads/N7
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
hello, tree
COMMIT
deleteall
M 644 inline foo/bar
data <<EOF
hello
EOF
SETUP_END
tree=$(git rev-parse --verify N7:) &&
git fast-import <<-INPUT_END &&
commit refs/heads/N8
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
copy to root by id and modify
COMMIT
M 040000 $tree $root
M 644 inline foo/foo
data <<EOF
hello, world
EOF
INPUT_END
git show N8:foo/foo >actual.foo &&
git show N8:foo/bar >actual.bar &&
test_cmp expect.foo actual.foo &&
test_cmp expect.bar actual.bar
++ echo 'hello, world'
++ echo hello
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 0 ( 4 duplicates )
blobs : 0 ( 1 duplicates 0 deltas of 0 attempts)
trees : 0 ( 2 duplicates 0 deltas of 0 attempts)
commits: 0 ( 1 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 2
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 2
pack_report: pack_mmap_calls = 1
pack_report: pack_open_windows = 1 / 1
pack_report: pack_mapped = 238 / 238
---------------------------------------------------------------------
+++ git rev-parse --verify N7:
++ tree=6ab387fae6bf9acb414e02264b09ec4b0c41adcc
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 0 ( 4 duplicates )
blobs : 0 ( 1 duplicates 0 deltas of 0 attempts)
trees : 0 ( 2 duplicates 0 deltas of 0 attempts)
commits: 0 ( 1 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 2
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 5
pack_report: pack_mmap_calls = 2
pack_report: pack_open_windows = 2 / 2
pack_report: pack_mapped = 538 / 538
---------------------------------------------------------------------
++ git show N8:foo/foo
++ git show N8:foo/bar
++ test_cmp expect.foo actual.foo
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect.foo actual.foo
++ test_cmp expect.bar actual.bar
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect.bar actual.bar
ok 93 - N: copy to root () by id and modify
expecting success of 9300.94 'N: extract subtree to the root ()':
branch=$(git rev-parse --verify refs/heads/branch^{tree}) &&
cat >input <<-INPUT_END &&
commit refs/heads/N9
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
extract subtree branch:newdir
COMMIT
M 040000 $branch $root
C "newdir" $root
INPUT_END
git fast-import <input &&
git diff --exit-code branch:newdir N9
+++ git rev-parse --verify 'refs/heads/branch^{tree}'
++ branch=8be2429e4b59e11149f8c84d6095f73828a99557
++ cat
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 0 ( 1 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 0 ( 0 duplicates 0 deltas of 0 attempts)
commits: 0 ( 1 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 3
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 4
pack_report: pack_mmap_calls = 2
pack_report: pack_open_windows = 2 / 2
pack_report: pack_mapped = 621 / 621
---------------------------------------------------------------------
++ git diff --exit-code branch:newdir N9
ok 94 - N: extract subtree to the root ()
expecting success of 9300.95 'N: modify subtree, extract it to the root (), and modify again':
echo hello >expect.baz &&
echo hello, world >expect.qux &&
git fast-import <<-SETUP_END &&
commit refs/heads/N10
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
hello, tree
COMMIT
deleteall
M 644 inline foo/bar/baz
data <<EOF
hello
EOF
SETUP_END
tree=$(git rev-parse --verify N10:) &&
git fast-import <<-INPUT_END &&
commit refs/heads/N11
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
copy to root by id and modify
COMMIT
M 040000 $tree $root
M 100644 inline foo/bar/qux
data <<EOF
hello, world
EOF
R "foo" $root
C "bar/qux" "bar/quux"
INPUT_END
git show N11:bar/baz >actual.baz &&
git show N11:bar/qux >actual.qux &&
git show N11:bar/quux >actual.quux &&
test_cmp expect.baz actual.baz &&
test_cmp expect.qux actual.qux &&
test_cmp expect.qux actual.quux
++ echo hello
++ echo hello, world
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 0 ( 5 duplicates )
blobs : 0 ( 1 duplicates 0 deltas of 0 attempts)
trees : 0 ( 3 duplicates 0 deltas of 0 attempts)
commits: 0 ( 1 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 3
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 2
pack_report: pack_mmap_calls = 1
pack_report: pack_open_windows = 1 / 1
pack_report: pack_mapped = 156 / 156
---------------------------------------------------------------------
+++ git rev-parse --verify N10:
++ tree=2542a3b2478a94f6dd2dae1a156e618a9d8bcda8
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 0 ( 4 duplicates )
blobs : 0 ( 1 duplicates 0 deltas of 0 attempts)
trees : 0 ( 2 duplicates 0 deltas of 0 attempts)
commits: 0 ( 1 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 5
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 6
pack_report: pack_mmap_calls = 2
pack_report: pack_open_windows = 2 / 2
pack_report: pack_mapped = 833 / 833
---------------------------------------------------------------------
++ git show N11:bar/baz
++ git show N11:bar/qux
++ git show N11:bar/quux
++ test_cmp expect.baz actual.baz
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect.baz actual.baz
++ test_cmp expect.qux actual.qux
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect.qux actual.qux
++ test_cmp expect.qux actual.quux
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect.qux actual.quux
ok 95 - N: modify subtree, extract it to the root (), and modify again
expecting success of 9300.96 'O: comments are all skipped':
cat >input <<-INPUT_END &&
#we will
commit refs/heads/O1
# -- ignore all of this text
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
dirty directory copy
COMMIT
# do not forget the import blank line!
#
# yes, we started from our usual base of branch^0.
# i like branch^0.
from refs/heads/branch^0
# and we need to reuse file2/file5 from N3 above.
M 644 inline file2/file5
# otherwise the tree will be different
data <<EOF
$file5_data
EOF
# do not forget to copy file2 to file3
C file2 file3
#
# or to delete file5 from file2.
D file2/file5
# are we done yet?
INPUT_END
git fast-import <input &&
test $(git rev-parse N3) = $(git rev-parse O1)
++ cat
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 0 ( 5 duplicates )
blobs : 0 ( 1 duplicates 0 deltas of 0 attempts)
trees : 0 ( 3 duplicates 0 deltas of 0 attempts)
commits: 0 ( 1 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 7
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 7
pack_report: pack_mmap_calls = 4
pack_report: pack_open_windows = 4 / 4
pack_report: pack_mapped = 1170 / 1170
---------------------------------------------------------------------
+++ git rev-parse N3
+++ git rev-parse O1
++ test c9fa8f49cd89b0c79e2653acbf382fc67897cacc = c9fa8f49cd89b0c79e2653acbf382fc67897cacc
ok 96 - O: comments are all skipped
expecting success of 9300.97 'O: blank lines not necessary after data commands':
cat >input <<-INPUT_END &&
commit refs/heads/O2
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
dirty directory copy
COMMIT
from refs/heads/branch^0
M 644 inline file2/file5
data <<EOF
$file5_data
EOF
C file2 file3
D file2/file5
INPUT_END
git fast-import <input &&
test $(git rev-parse N3) = $(git rev-parse O2)
++ cat
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 0 ( 5 duplicates )
blobs : 0 ( 1 duplicates 0 deltas of 0 attempts)
trees : 0 ( 3 duplicates 0 deltas of 0 attempts)
commits: 0 ( 1 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 7
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 7
pack_report: pack_mmap_calls = 4
pack_report: pack_open_windows = 4 / 4
pack_report: pack_mapped = 1170 / 1170
---------------------------------------------------------------------
+++ git rev-parse N3
+++ git rev-parse O2
++ test c9fa8f49cd89b0c79e2653acbf382fc67897cacc = c9fa8f49cd89b0c79e2653acbf382fc67897cacc
ok 97 - O: blank lines not necessary after data commands
expecting success of 9300.98 'O: repack before next test':
git repack -a -d
++ git repack -a -d
Enumerating objects: 101, done.
Counting objects: 100% (101/101), done.
Delta compression using up to 4 threads
Compressing objects: 100% (61/61), done.
Writing objects: 100% (101/101), done.
Total 101 (delta 26), reused 78 (delta 4), pack-reused 0 (from 0)
ok 98 - O: repack before next test
expecting success of 9300.99 'O: blank lines not necessary after other commands':
cat >input <<-INPUT_END &&
commit refs/heads/O3
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
zstring
COMMIT
commit refs/heads/O3
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
zof
COMMIT
checkpoint
commit refs/heads/O3
mark :5
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
zempty
COMMIT
checkpoint
commit refs/heads/O3
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
zcommits
COMMIT
reset refs/tags/O3-2nd
from :5
reset refs/tags/O3-3rd
from :5
INPUT_END
cat >expect <<-INPUT_END &&
string
of
empty
commits
INPUT_END
git fast-import <input &&
ls -la .git/objects/pack/pack-*.pack >packlist &&
ls -la .git/objects/pack/pack-*.pack >idxlist &&
test_line_count = 4 idxlist &&
test_line_count = 4 packlist &&
test $(git rev-parse refs/tags/O3-2nd) = $(git rev-parse O3^) &&
git log --reverse --pretty=oneline O3 | sed s/^.*z// >actual &&
test_cmp expect actual
++ cat
++ cat
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 4 ( 1 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 0 ( 1 duplicates 0 deltas of 0 attempts)
commits: 4 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 3 ( 1 loads )
marks: 1024 ( 1 unique )
atoms: 0
Memory total: 2399 KiB
pools: 2048 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 8
pack_report: pack_mmap_calls = 3
pack_report: pack_open_windows = 3 / 3
pack_report: pack_mapped = 667 / 667
---------------------------------------------------------------------
++ ls -la .git/objects/pack/pack-2d541ad89d29dbdf040d15628522b485d30bb420.pack .git/objects/pack/pack-5adf9cd6ff59aa301d181109c9426ad3532e2be5.pack .git/objects/pack/pack-8d08bd1860f6662ce2ac98e5335cd3fbd0e298f7.pack .git/objects/pack/pack-f79b385dbdb0fb2a163030523194e374af3ebacb.pack
++ ls -la .git/objects/pack/pack-2d541ad89d29dbdf040d15628522b485d30bb420.pack .git/objects/pack/pack-5adf9cd6ff59aa301d181109c9426ad3532e2be5.pack .git/objects/pack/pack-8d08bd1860f6662ce2ac98e5335cd3fbd0e298f7.pack .git/objects/pack/pack-f79b385dbdb0fb2a163030523194e374af3ebacb.pack
++ test_line_count = 4 idxlist
++ test 3 '!=' 3
+++ wc -l
++ test 4 = 4
++ test_line_count = 4 packlist
++ test 3 '!=' 3
+++ wc -l
++ test 4 = 4
+++ git rev-parse refs/tags/O3-2nd
+++ git rev-parse 'O3^'
++ test c713cf4a9446ade70da02a4734370997de4d36e6 = c713cf4a9446ade70da02a4734370997de4d36e6
++ git log --reverse --pretty=oneline O3
++ sed 's/^.*z//'
++ test_cmp expect actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual
ok 99 - O: blank lines not necessary after other commands
expecting success of 9300.100 'O: progress outputs as requested by input':
cat >input <<-INPUT_END &&
commit refs/heads/O4
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
zstring
COMMIT
commit refs/heads/O4
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
zof
COMMIT
progress Two commits down, 2 to go!
commit refs/heads/O4
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
zempty
COMMIT
progress Three commits down, 1 to go!
commit refs/heads/O4
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
zcommits
COMMIT
progress done!
INPUT_END
git fast-import <input >actual &&
grep "progress " <input >expect &&
test_cmp expect actual
++ cat
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 0 ( 5 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 0 ( 1 duplicates 0 deltas of 0 attempts)
commits: 0 ( 4 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 0
Memory total: 2399 KiB
pools: 2048 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 2
pack_report: pack_mmap_calls = 1
pack_report: pack_open_windows = 1 / 1
pack_report: pack_mapped = 181 / 181
---------------------------------------------------------------------
++ grep 'progress '
++ test_cmp expect actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual
ok 100 - O: progress outputs as requested by input
expecting success of 9300.101 'P: superproject & submodule mix':
cat >input <<-INPUT_END &&
blob
mark :1
data 10
test file
reset refs/heads/sub
commit refs/heads/sub
mark :2
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data 12
sub_initial
M 100644 :1 file
blob
mark :3
data <<DATAEND
[submodule "sub"]
path = sub
url = "$(pwd)/sub"
DATAEND
commit refs/heads/subuse1
mark :4
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data 8
initial
from refs/heads/main
M 100644 :3 .gitmodules
M 160000 :2 sub
blob
mark :5
data 20
test file
more data
commit refs/heads/sub
mark :6
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data 11
sub_second
from :2
M 100644 :5 file
commit refs/heads/subuse1
mark :7
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data 7
second
from :4
M 160000 :6 sub
INPUT_END
git fast-import <input &&
git checkout subuse1 &&
rm -rf sub &&
mkdir sub &&
(
cd sub &&
git init &&
git fetch --update-head-ok .. refs/heads/sub:refs/heads/main &&
git checkout main
) &&
git submodule init &&
git submodule update
++ cat
+++ pwd
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 11 ( 0 duplicates )
blobs : 3 ( 0 duplicates 0 deltas of 1 attempts)
trees : 4 ( 0 duplicates 1 deltas of 2 attempts)
commits: 4 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 2 ( 2 loads )
marks: 1024 ( 7 unique )
atoms: 6
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 6
pack_report: pack_mmap_calls = 2
pack_report: pack_open_windows = 2 / 2
pack_report: pack_mapped = 8541 / 8541
---------------------------------------------------------------------
++ git checkout subuse1
Switched to branch 'subuse1'
++ rm -rf sub
++ mkdir sub
++ cd sub
++ git init
Initialized empty Git repository in /var/tmp/b/git/t/trash directory.t9300-fast-import/sub/.git/
++ git fetch --update-head-ok .. refs/heads/sub:refs/heads/main
remote: Enumerating objects: 6, done.
remote: Counting objects: 100% (6/6), done.
remote: Compressing objects: 100% (2/2), done.
remote: Total 6 (delta 0), reused 6 (delta 0), pack-reused 0 (from 0)
Unpacking objects: 100% (6/6), 425 bytes | 106.00 KiB/s, done.
From ..
* [new branch] sub -> main
++ git checkout main
Already on 'main'
++ git submodule init
Submodule 'sub' (/var/tmp/b/git/t/trash directory.t9300-fast-import/sub) registered for path 'sub'
++ git submodule update
ok 101 - P: superproject & submodule mix
expecting success of 9300.102 'P: verbatim SHA gitlinks':
SUBLAST=$(git rev-parse --verify sub) &&
SUBPREV=$(git rev-parse --verify sub^) &&
cat >input <<-INPUT_END &&
blob
mark :1
data <<DATAEND
[submodule "sub"]
path = sub
url = "$(pwd)/sub"
DATAEND
commit refs/heads/subuse2
mark :2
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data 8
initial
from refs/heads/main
M 100644 :1 .gitmodules
M 160000 $SUBPREV sub
commit refs/heads/subuse2
mark :3
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data 7
second
from :2
M 160000 $SUBLAST sub
INPUT_END
git branch -D sub &&
git gc --prune=now &&
git fast-import <input &&
test $(git rev-parse --verify subuse2) = $(git rev-parse --verify subuse1)
+++ git rev-parse --verify sub
++ SUBLAST=51a3fee918365f7a27147e0062ab303433bdb6d0
+++ git rev-parse --verify 'sub^'
++ SUBPREV=748a285b849bb59b375bb91ddeb1423cebca5dbf
++ cat
+++ pwd
++ git branch -D sub
Deleted branch sub (was 51a3fee).
++ git gc --prune=now
Enumerating objects: 109, done.
Counting objects: 100% (109/109), done.
Delta compression using up to 4 threads
Compressing objects: 100% (47/47), done.
Writing objects: 100% (109/109), done.
Total 109 (delta 33), reused 102 (delta 26), pack-reused 0 (from 0)
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 0 ( 5 duplicates )
blobs : 0 ( 1 duplicates 0 deltas of 0 attempts)
trees : 0 ( 2 duplicates 0 deltas of 0 attempts)
commits: 0 ( 2 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 3 unique )
atoms: 5
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 4
pack_report: pack_mmap_calls = 1
pack_report: pack_open_windows = 1 / 1
pack_report: pack_mapped = 8039 / 8039
---------------------------------------------------------------------
+++ git rev-parse --verify subuse2
+++ git rev-parse --verify subuse1
++ test c281a9691c7fe3cad66d25a374a13f3b1ad983e7 = c281a9691c7fe3cad66d25a374a13f3b1ad983e7
ok 102 - P: verbatim SHA gitlinks
expecting success of 9300.103 'P: fail on inline gitlink':
test_tick &&
cat >input <<-INPUT_END &&
commit refs/heads/subuse3
mark :1
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
corrupt
COMMIT
from refs/heads/subuse2
M 160000 inline sub
data <<DATA
$SUBPREV
DATA
INPUT_END
test_must_fail git fast-import <input
++ test_tick
++ test -z set
++ test_tick=1112912713
++ GIT_COMMITTER_DATE='1112912713 -0700'
++ GIT_AUTHOR_DATE='1112912713 -0700'
++ export GIT_COMMITTER_DATE GIT_AUTHOR_DATE
++ cat
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
fatal: Git links cannot be specified 'inline': M 160000 inline sub
fast-import: dumping crash report to .git/fast_import_crash_1944041
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
ok 103 - P: fail on inline gitlink
expecting success of 9300.104 'P: fail on blob mark in gitlink':
test_tick &&
cat >input <<-INPUT_END &&
blob
mark :1
data <<DATA
$SUBPREV
DATA
commit refs/heads/subuse3
mark :2
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
corrupt
COMMIT
from refs/heads/subuse2
M 160000 :1 sub
INPUT_END
test_must_fail git fast-import <input
++ test_tick
++ test -z set
++ test_tick=1112912773
++ GIT_COMMITTER_DATE='1112912773 -0700'
++ GIT_AUTHOR_DATE='1112912773 -0700'
++ export GIT_COMMITTER_DATE GIT_AUTHOR_DATE
++ cat
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
fatal: Not a commit (actually a blob): M 160000 :1 sub
fast-import: dumping crash report to .git/fast_import_crash_1944044
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
ok 104 - P: fail on blob mark in gitlink
expecting success of 9300.105 'Q: commit notes':
note1_data="The first note for the first commit" &&
note2_data="The first note for the second commit" &&
note3_data="The first note for the third commit" &&
note1b_data="The second note for the first commit" &&
note1c_data="The third note for the first commit" &&
note2b_data="The second note for the second commit" &&
test_tick &&
cat >input <<-INPUT_END &&
blob
mark :2
data <<EOF
$file2_data
EOF
commit refs/heads/notes-test
mark :3
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
first (:3)
COMMIT
M 644 :2 file2
blob
mark :4
data $file4_len
$file4_data
commit refs/heads/notes-test
mark :5
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
second (:5)
COMMIT
M 644 :4 file4
commit refs/heads/notes-test
mark :6
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
third (:6)
COMMIT
M 644 inline file5
data <<EOF
$file5_data
EOF
M 755 inline file6
data <<EOF
$file6_data
EOF
blob
mark :7
data <<EOF
$note1_data
EOF
blob
mark :8
data <<EOF
$note2_data
EOF
commit refs/notes/foobar
mark :9
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
notes (:9)
COMMIT
N :7 :3
N :8 :5
N inline :6
data <<EOF
$note3_data
EOF
commit refs/notes/foobar
mark :10
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
notes (:10)
COMMIT
N inline :3
data <<EOF
$note1b_data
EOF
commit refs/notes/foobar2
mark :11
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
notes (:11)
COMMIT
N inline :3
data <<EOF
$note1c_data
EOF
commit refs/notes/foobar
mark :12
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
notes (:12)
COMMIT
deleteall
N inline :5
data <<EOF
$note2b_data
EOF
INPUT_END
git fast-import <input &&
git whatchanged notes-test
++ note1_data='The first note for the first commit'
++ note2_data='The first note for the second commit'
++ note3_data='The first note for the third commit'
++ note1b_data='The second note for the first commit'
++ note1c_data='The third note for the first commit'
++ note2b_data='The second note for the second commit'
++ test_tick
++ test -z set
++ test_tick=1112912833
++ GIT_COMMITTER_DATE='1112912833 -0700'
++ GIT_AUTHOR_DATE='1112912833 -0700'
++ export GIT_COMMITTER_DATE GIT_AUTHOR_DATE
++ cat
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 20 ( 4 duplicates )
blobs : 6 ( 4 duplicates 0 deltas of 5 attempts)
trees : 7 ( 0 duplicates 3 deltas of 3 attempts)
commits: 7 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 3 ( 3 loads )
marks: 1024 ( 11 unique )
atoms: 7
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 6
pack_report: pack_mmap_calls = 1
pack_report: pack_open_windows = 1 / 1
pack_report: pack_mapped = 1877 / 1877
---------------------------------------------------------------------
++ git whatchanged notes-test
commit 7aa420e73b93d5b69059a2ff8e850a2ed9411187 (notes-test)
Author: C O Mitter <[email protected]>
Date: Thu Apr 7 15:27:13 2005 -0700
third (:6)
:000000 100644 0000000 fcf778c A file5
:000000 100755 0000000 e74b7d4 A file6
commit 42eaf85509b2f5a0e75780657349147fbd74b4f3
Author: C O Mitter <[email protected]>
Date: Thu Apr 7 15:27:13 2005 -0700
second (:5)
:000000 100644 0000000 85df507 A file4
commit 08ee95cbee172e3f9b93ebbb501101ad3023d6ed
Author: C O Mitter <[email protected]>
Date: Thu Apr 7 15:27:13 2005 -0700
first (:3)
:000000 100644 0000000 7123f7f A file2
ok 105 - Q: commit notes
expecting success of 9300.106 'Q: verify pack':
verify_packs
++ verify_packs
++ for p in .git/objects/pack/*.pack
++ git verify-pack .git/objects/pack/pack-577d68e0c08bd10db399761a197fab58013ab9dc.pack
++ for p in .git/objects/pack/*.pack
++ git verify-pack .git/objects/pack/pack-8f3bef78392a85b4482301f6e0240a109c08af76.pack
++ for p in .git/objects/pack/*.pack
++ git verify-pack .git/objects/pack/pack-c479dd097802b0bb8924faeeae10a0403f902d70.pack
ok 106 - Q: verify pack
expecting success of 9300.107 'Q: verify first commit':
commit1=$(git rev-parse notes-test~2) &&
commit2=$(git rev-parse notes-test^) &&
commit3=$(git rev-parse notes-test) &&
cat >expect <<-EOF &&
author $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
first (:3)
EOF
git cat-file commit notes-test~2 | sed 1d >actual &&
test_cmp expect actual
+++ git rev-parse notes-test~2
++ commit1=08ee95cbee172e3f9b93ebbb501101ad3023d6ed
+++ git rev-parse 'notes-test^'
++ commit2=42eaf85509b2f5a0e75780657349147fbd74b4f3
+++ git rev-parse notes-test
++ commit3=7aa420e73b93d5b69059a2ff8e850a2ed9411187
++ cat
++ git cat-file commit notes-test~2
++ sed 1d
++ test_cmp expect actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual
ok 107 - Q: verify first commit
expecting success of 9300.108 'Q: verify second commit':
cat >expect <<-EOF &&
parent $commit1
author $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
second (:5)
EOF
git cat-file commit notes-test^ | sed 1d >actual &&
test_cmp expect actual
++ cat
++ git cat-file commit 'notes-test^'
++ sed 1d
++ test_cmp expect actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual
ok 108 - Q: verify second commit
expecting success of 9300.109 'Q: verify third commit':
cat >expect <<-EOF &&
parent $commit2
author $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
third (:6)
EOF
git cat-file commit notes-test | sed 1d >actual &&
test_cmp expect actual
++ cat
++ sed 1d
++ git cat-file commit notes-test
++ test_cmp expect actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual
ok 109 - Q: verify third commit
expecting success of 9300.110 'Q: verify first notes commit':
cat >expect <<-EOF &&
author $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
notes (:9)
EOF
git cat-file commit refs/notes/foobar~2 | sed 1d >actual &&
test_cmp expect actual
++ cat
++ git cat-file commit refs/notes/foobar~2
++ sed 1d
++ test_cmp expect actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual
ok 110 - Q: verify first notes commit
expecting success of 9300.111 'Q: verify first notes tree':
sort >expect <<-EOF &&
100644 blob $commit1
100644 blob $commit2
100644 blob $commit3
EOF
git cat-file -p refs/notes/foobar~2^{tree} | sed "s/ [0-9a-f]* / /" >actual &&
test_cmp expect actual
++ sort
++ git cat-file -p 'refs/notes/foobar~2^{tree}'
++ sed 's/ [0-9a-f]* / /'
++ test_cmp expect actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual
ok 111 - Q: verify first notes tree
expecting success of 9300.112 'Q: verify first note for first commit':
echo "$note1_data" >expect &&
git cat-file blob refs/notes/foobar~2:$commit1 >actual &&
test_cmp expect actual
++ echo 'The first note for the first commit'
++ git cat-file blob refs/notes/foobar~2:08ee95cbee172e3f9b93ebbb501101ad3023d6ed
++ test_cmp expect actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual
ok 112 - Q: verify first note for first commit
expecting success of 9300.113 'Q: verify first note for second commit':
echo "$note2_data" >expect &&
git cat-file blob refs/notes/foobar~2:$commit2 >actual &&
test_cmp expect actual
++ echo 'The first note for the second commit'
++ git cat-file blob refs/notes/foobar~2:42eaf85509b2f5a0e75780657349147fbd74b4f3
++ test_cmp expect actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual
ok 113 - Q: verify first note for second commit
expecting success of 9300.114 'Q: verify first note for third commit':
echo "$note3_data" >expect &&
git cat-file blob refs/notes/foobar~2:$commit3 >actual &&
test_cmp expect actual
++ echo 'The first note for the third commit'
++ git cat-file blob refs/notes/foobar~2:7aa420e73b93d5b69059a2ff8e850a2ed9411187
++ test_cmp expect actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual
ok 114 - Q: verify first note for third commit
expecting success of 9300.115 'Q: verify second notes commit':
cat >expect <<-EOF &&
parent $(git rev-parse --verify refs/notes/foobar~2)
author $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
notes (:10)
EOF
git cat-file commit refs/notes/foobar^ | sed 1d >actual &&
test_cmp expect actual
++ cat
+++ git rev-parse --verify refs/notes/foobar~2
++ sed 1d
++ git cat-file commit 'refs/notes/foobar^'
++ test_cmp expect actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual
ok 115 - Q: verify second notes commit
expecting success of 9300.116 'Q: verify second notes tree':
sort >expect <<-EOF &&
100644 blob $commit1
100644 blob $commit2
100644 blob $commit3
EOF
git cat-file -p refs/notes/foobar^^{tree} | sed "s/ [0-9a-f]* / /" >actual &&
test_cmp expect actual
++ sort
++ git cat-file -p 'refs/notes/foobar^^{tree}'
++ sed 's/ [0-9a-f]* / /'
++ test_cmp expect actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual
ok 116 - Q: verify second notes tree
expecting success of 9300.117 'Q: verify second note for first commit':
echo "$note1b_data" >expect &&
git cat-file blob refs/notes/foobar^:$commit1 >actual &&
test_cmp expect actual
++ echo 'The second note for the first commit'
++ git cat-file blob 'refs/notes/foobar^:08ee95cbee172e3f9b93ebbb501101ad3023d6ed'
++ test_cmp expect actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual
ok 117 - Q: verify second note for first commit
expecting success of 9300.118 'Q: verify first note for second commit':
echo "$note2_data" >expect &&
git cat-file blob refs/notes/foobar^:$commit2 >actual &&
test_cmp expect actual
++ echo 'The first note for the second commit'
++ git cat-file blob 'refs/notes/foobar^:42eaf85509b2f5a0e75780657349147fbd74b4f3'
++ test_cmp expect actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual
ok 118 - Q: verify first note for second commit
expecting success of 9300.119 'Q: verify first note for third commit':
echo "$note3_data" >expect &&
git cat-file blob refs/notes/foobar^:$commit3 >actual &&
test_cmp expect actual
++ echo 'The first note for the third commit'
++ git cat-file blob 'refs/notes/foobar^:7aa420e73b93d5b69059a2ff8e850a2ed9411187'
++ test_cmp expect actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual
ok 119 - Q: verify first note for third commit
expecting success of 9300.120 'Q: verify third notes commit':
cat >expect <<-EOF &&
author $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
notes (:11)
EOF
git cat-file commit refs/notes/foobar2 | sed 1d >actual &&
test_cmp expect actual
++ cat
++ git cat-file commit refs/notes/foobar2
++ sed 1d
++ test_cmp expect actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual
ok 120 - Q: verify third notes commit
expecting success of 9300.121 'Q: verify third notes tree':
sort >expect <<-EOF &&
100644 blob $commit1
EOF
git cat-file -p refs/notes/foobar2^{tree} | sed "s/ [0-9a-f]* / /" >actual &&
test_cmp expect actual
++ sort
++ sed 's/ [0-9a-f]* / /'
++ git cat-file -p 'refs/notes/foobar2^{tree}'
++ test_cmp expect actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual
ok 121 - Q: verify third notes tree
expecting success of 9300.122 'Q: verify third note for first commit':
echo "$note1c_data" >expect &&
git cat-file blob refs/notes/foobar2:$commit1 >actual &&
test_cmp expect actual
++ echo 'The third note for the first commit'
++ git cat-file blob refs/notes/foobar2:08ee95cbee172e3f9b93ebbb501101ad3023d6ed
++ test_cmp expect actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual
ok 122 - Q: verify third note for first commit
expecting success of 9300.123 'Q: verify fourth notes commit':
cat >expect <<-EOF &&
parent $(git rev-parse --verify refs/notes/foobar^)
author $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
notes (:12)
EOF
git cat-file commit refs/notes/foobar | sed 1d >actual &&
test_cmp expect actual
++ cat
+++ git rev-parse --verify 'refs/notes/foobar^'
++ git cat-file commit refs/notes/foobar
++ sed 1d
++ test_cmp expect actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual
ok 123 - Q: verify fourth notes commit
expecting success of 9300.124 'Q: verify fourth notes tree':
sort >expect <<-EOF &&
100644 blob $commit2
EOF
git cat-file -p refs/notes/foobar^{tree} | sed "s/ [0-9a-f]* / /" >actual &&
test_cmp expect actual
++ sort
++ git cat-file -p 'refs/notes/foobar^{tree}'
++ sed 's/ [0-9a-f]* / /'
++ test_cmp expect actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual
ok 124 - Q: verify fourth notes tree
expecting success of 9300.125 'Q: verify second note for second commit':
echo "$note2b_data" >expect &&
git cat-file blob refs/notes/foobar:$commit2 >actual &&
test_cmp expect actual
++ echo 'The second note for the second commit'
++ git cat-file blob refs/notes/foobar:42eaf85509b2f5a0e75780657349147fbd74b4f3
++ test_cmp expect actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual
ok 125 - Q: verify second note for second commit
expecting success of 9300.126 'Q: deny note on empty branch':
cat >input <<-EOF &&
reset refs/heads/Q0
commit refs/heads/note-Q0
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
Note for an empty branch.
COMMIT
N inline refs/heads/Q0
data <<NOTE
some note
NOTE
EOF
test_must_fail git fast-import <input
++ cat
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
fatal: Can't add a note on empty branch.
fast-import: dumping crash report to .git/fast_import_crash_1944143
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
ok 126 - Q: deny note on empty branch
expecting success of 9300.127 'R: abort on unsupported feature':
cat >input <<-EOF &&
feature no-such-feature-exists
EOF
test_must_fail git fast-import <input
++ cat
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
fatal: This version of fast-import does not support feature no-such-feature-exists.
fast-import: dumping crash report to .git/fast_import_crash_1944145
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
ok 127 - R: abort on unsupported feature
expecting success of 9300.128 'R: supported feature is accepted':
cat >input <<-EOF &&
feature date-format=now
EOF
git fast-import <input
++ cat
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 0 ( 0 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 0 ( 0 duplicates 0 deltas of 0 attempts)
commits: 0 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 0 ( 0 loads )
marks: 1024 ( 0 unique )
atoms: 0
Memory total: 2399 KiB
pools: 2048 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 0
pack_report: core.packedGitLimit = 0
pack_report: pack_used_ctr = 0
pack_report: pack_mmap_calls = 0
pack_report: pack_open_windows = 0 / 0
pack_report: pack_mapped = 0 / 0
---------------------------------------------------------------------
ok 128 - R: supported feature is accepted
expecting success of 9300.129 'R: abort on receiving feature after data command':
cat >input <<-EOF &&
blob
data 3
hi
feature date-format=now
EOF
test_must_fail git fast-import <input
++ cat
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
fatal: Got feature command 'date-format=now' after data command
fast-import: dumping crash report to .git/fast_import_crash_1944149
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
ok 129 - R: abort on receiving feature after data command
expecting success of 9300.130 'R: import-marks features forbidden by default':
>git.marks &&
echo "feature import-marks=git.marks" >input &&
test_must_fail git fast-import <input &&
echo "feature import-marks-if-exists=git.marks" >input &&
test_must_fail git fast-import <input
++ echo 'feature import-marks=git.marks'
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
fatal: feature 'import-marks' forbidden in input without --allow-unsafe-features
fast-import: dumping crash report to .git/fast_import_crash_1944150
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ echo 'feature import-marks-if-exists=git.marks'
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
fatal: feature 'import-marks-if-exists' forbidden in input without --allow-unsafe-features
fast-import: dumping crash report to .git/fast_import_crash_1944151
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
ok 130 - R: import-marks features forbidden by default
expecting success of 9300.131 'R: only one import-marks feature allowed per stream':
>git.marks &&
>git2.marks &&
cat >input <<-EOF &&
feature import-marks=git.marks
feature import-marks=git2.marks
EOF
test_must_fail git fast-import --allow-unsafe-features <input
++ cat
++ test_must_fail git fast-import --allow-unsafe-features
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import --allow-unsafe-features
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import --allow-unsafe-features
fatal: Only one import-marks command allowed per stream
fast-import: dumping crash report to .git/fast_import_crash_1944153
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
ok 131 - R: only one import-marks feature allowed per stream
expecting success of 9300.132 'R: export-marks feature forbidden by default':
echo "feature export-marks=git.marks" >input &&
test_must_fail git fast-import <input
++ echo 'feature export-marks=git.marks'
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
fatal: feature 'export-marks=git.marks' forbidden in input without --allow-unsafe-features
fast-import: dumping crash report to .git/fast_import_crash_1944154
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
ok 132 - R: export-marks feature forbidden by default
expecting success of 9300.133 'R: export-marks feature results in a marks file being created':
cat >input <<-EOF &&
feature export-marks=git.marks
blob
mark :1
data 3
hi
EOF
git fast-import --allow-unsafe-features <input &&
grep :1 git.marks
++ cat
++ git fast-import --allow-unsafe-features
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 0 ( 1 duplicates )
blobs : 0 ( 1 duplicates 0 deltas of 0 attempts)
trees : 0 ( 0 duplicates 0 deltas of 0 attempts)
commits: 0 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 0 ( 0 loads )
marks: 1024 ( 1 unique )
atoms: 0
Memory total: 2399 KiB
pools: 2048 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 0
pack_report: pack_mmap_calls = 0
pack_report: pack_open_windows = 0 / 0
pack_report: pack_mapped = 0 / 0
---------------------------------------------------------------------
++ grep :1 git.marks
:1 45b983be36b73c0788dc9cbcb76cbb80fc7bb057
ok 133 - R: export-marks feature results in a marks file being created
expecting success of 9300.134 'R: export-marks options can be overridden by commandline options':
cat >input <<-\EOF &&
feature export-marks=feature-sub/git.marks
blob
mark :1
data 3
hi
EOF
git fast-import --allow-unsafe-features \
--export-marks=cmdline-sub/other.marks <input &&
grep :1 cmdline-sub/other.marks &&
test_path_is_missing feature-sub
++ cat
++ git fast-import --allow-unsafe-features --export-marks=cmdline-sub/other.marks
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 0 ( 1 duplicates )
blobs : 0 ( 1 duplicates 0 deltas of 0 attempts)
trees : 0 ( 0 duplicates 0 deltas of 0 attempts)
commits: 0 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 0 ( 0 loads )
marks: 1024 ( 1 unique )
atoms: 0
Memory total: 2399 KiB
pools: 2048 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 0
pack_report: pack_mmap_calls = 0
pack_report: pack_open_windows = 0 / 0
pack_report: pack_mapped = 0 / 0
---------------------------------------------------------------------
++ grep :1 cmdline-sub/other.marks
:1 45b983be36b73c0788dc9cbcb76cbb80fc7bb057
++ test_path_is_missing feature-sub
++ test 1 -ne 1
++ test -e feature-sub
ok 134 - R: export-marks options can be overridden by commandline options
expecting success of 9300.135 'R: catch typo in marks file name':
test_must_fail git fast-import --import-marks=nonexistent.marks </dev/null &&
echo "feature import-marks=nonexistent.marks" |
test_must_fail git fast-import --allow-unsafe-features
++ test_must_fail git fast-import --import-marks=nonexistent.marks
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import --import-marks=nonexistent.marks
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import --import-marks=nonexistent.marks
fatal: cannot read 'nonexistent.marks': No such file or directory
fast-import: dumping crash report to .git/fast_import_crash_1944161
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ echo 'feature import-marks=nonexistent.marks'
++ test_must_fail git fast-import --allow-unsafe-features
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import --allow-unsafe-features
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import --allow-unsafe-features
fatal: cannot read 'nonexistent.marks': No such file or directory
fast-import: dumping crash report to .git/fast_import_crash_1944164
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
ok 135 - R: catch typo in marks file name
expecting success of 9300.136 'R: import and output marks can be the same file':
rm -f io.marks &&
blob=$(echo hi | git hash-object --stdin) &&
cat >expect <<-EOF &&
:1 $blob
:2 $blob
EOF
git fast-import --export-marks=io.marks <<-\EOF &&
blob
mark :1
data 3
hi
EOF
git fast-import --import-marks=io.marks --export-marks=io.marks <<-\EOF &&
blob
mark :2
data 3
hi
EOF
test_cmp expect io.marks
++ rm -f io.marks
+++ echo hi
+++ git hash-object --stdin
++ blob=45b983be36b73c0788dc9cbcb76cbb80fc7bb057
++ cat
++ git fast-import --export-marks=io.marks
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 0 ( 1 duplicates )
blobs : 0 ( 1 duplicates 0 deltas of 0 attempts)
trees : 0 ( 0 duplicates 0 deltas of 0 attempts)
commits: 0 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 0 ( 0 loads )
marks: 1024 ( 1 unique )
atoms: 0
Memory total: 2399 KiB
pools: 2048 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 0
pack_report: pack_mmap_calls = 0
pack_report: pack_open_windows = 0 / 0
pack_report: pack_mapped = 0 / 0
---------------------------------------------------------------------
++ git fast-import --import-marks=io.marks --export-marks=io.marks
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 0 ( 1 duplicates )
blobs : 0 ( 1 duplicates 0 deltas of 0 attempts)
trees : 0 ( 0 duplicates 0 deltas of 0 attempts)
commits: 0 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 0 ( 0 loads )
marks: 1024 ( 2 unique )
atoms: 0
Memory total: 2399 KiB
pools: 2048 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 1
pack_report: pack_mmap_calls = 1
pack_report: pack_open_windows = 1 / 1
pack_report: pack_mapped = 44 / 44
---------------------------------------------------------------------
++ test_cmp expect io.marks
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect io.marks
ok 136 - R: import and output marks can be the same file
expecting success of 9300.137 'R: --import-marks=foo --output-marks=foo to create foo fails':
rm -f io.marks &&
test_must_fail git fast-import --import-marks=io.marks --export-marks=io.marks <<-\EOF
blob
mark :1
data 3
hi
EOF
++ rm -f io.marks
++ test_must_fail git fast-import --import-marks=io.marks --export-marks=io.marks
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import --import-marks=io.marks --export-marks=io.marks
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import --import-marks=io.marks --export-marks=io.marks
fatal: cannot read 'io.marks': No such file or directory
fast-import: dumping crash report to .git/fast_import_crash_1944174
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
ok 137 - R: --import-marks=foo --output-marks=foo to create foo fails
expecting success of 9300.138 'R: --import-marks-if-exists':
rm -f io.marks &&
blob=$(echo hi | git hash-object --stdin) &&
echo ":1 $blob" >expect &&
git fast-import --import-marks-if-exists=io.marks --export-marks=io.marks <<-\EOF &&
blob
mark :1
data 3
hi
EOF
test_cmp expect io.marks
++ rm -f io.marks
+++ echo hi
+++ git hash-object --stdin
++ blob=45b983be36b73c0788dc9cbcb76cbb80fc7bb057
++ echo ':1 45b983be36b73c0788dc9cbcb76cbb80fc7bb057'
++ git fast-import --import-marks-if-exists=io.marks --export-marks=io.marks
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 0 ( 1 duplicates )
blobs : 0 ( 1 duplicates 0 deltas of 0 attempts)
trees : 0 ( 0 duplicates 0 deltas of 0 attempts)
commits: 0 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 0 ( 0 loads )
marks: 1024 ( 1 unique )
atoms: 0
Memory total: 2399 KiB
pools: 2048 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 0
pack_report: pack_mmap_calls = 0
pack_report: pack_open_windows = 0 / 0
pack_report: pack_mapped = 0 / 0
---------------------------------------------------------------------
++ test_cmp expect io.marks
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect io.marks
ok 138 - R: --import-marks-if-exists
expecting success of 9300.139 'R: feature import-marks-if-exists':
rm -f io.marks &&
git fast-import --export-marks=io.marks \
--allow-unsafe-features <<-\EOF &&
feature import-marks-if-exists=not_io.marks
EOF
test_must_be_empty io.marks &&
blob=$(echo hi | git hash-object --stdin) &&
echo ":1 $blob" >io.marks &&
echo ":1 $blob" >expect &&
echo ":2 $blob" >>expect &&
git fast-import --export-marks=io.marks \
--allow-unsafe-features <<-\EOF &&
feature import-marks-if-exists=io.marks
blob
mark :2
data 3
hi
EOF
test_cmp expect io.marks &&
echo ":3 $blob" >>expect &&
git fast-import --import-marks=io.marks \
--export-marks=io.marks \
--allow-unsafe-features <<-\EOF &&
feature import-marks-if-exists=not_io.marks
blob
mark :3
data 3
hi
EOF
test_cmp expect io.marks &&
git fast-import --import-marks-if-exists=not_io.marks \
--export-marks=io.marks \
--allow-unsafe-features <<-\EOF &&
feature import-marks-if-exists=io.marks
EOF
test_must_be_empty io.marks
++ rm -f io.marks
++ git fast-import --export-marks=io.marks --allow-unsafe-features
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 0 ( 0 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 0 ( 0 duplicates 0 deltas of 0 attempts)
commits: 0 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 0 ( 0 loads )
marks: 1024 ( 0 unique )
atoms: 0
Memory total: 2399 KiB
pools: 2048 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 0
pack_report: core.packedGitLimit = 0
pack_report: pack_used_ctr = 0
pack_report: pack_mmap_calls = 0
pack_report: pack_open_windows = 0 / 0
pack_report: pack_mapped = 0 / 0
---------------------------------------------------------------------
++ test_must_be_empty io.marks
++ test 1 -ne 1
++ test_path_is_file io.marks
++ test 1 -ne 1
++ test -f io.marks
++ test -s io.marks
+++ echo hi
+++ git hash-object --stdin
++ blob=45b983be36b73c0788dc9cbcb76cbb80fc7bb057
++ echo ':1 45b983be36b73c0788dc9cbcb76cbb80fc7bb057'
++ echo ':1 45b983be36b73c0788dc9cbcb76cbb80fc7bb057'
++ echo ':2 45b983be36b73c0788dc9cbcb76cbb80fc7bb057'
++ git fast-import --export-marks=io.marks --allow-unsafe-features
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 0 ( 1 duplicates )
blobs : 0 ( 1 duplicates 0 deltas of 0 attempts)
trees : 0 ( 0 duplicates 0 deltas of 0 attempts)
commits: 0 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 0 ( 0 loads )
marks: 1024 ( 2 unique )
atoms: 0
Memory total: 2399 KiB
pools: 2048 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 1
pack_report: pack_mmap_calls = 1
pack_report: pack_open_windows = 1 / 1
pack_report: pack_mapped = 44 / 44
---------------------------------------------------------------------
++ test_cmp expect io.marks
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect io.marks
++ echo ':3 45b983be36b73c0788dc9cbcb76cbb80fc7bb057'
++ git fast-import --import-marks=io.marks --export-marks=io.marks --allow-unsafe-features
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 0 ( 1 duplicates )
blobs : 0 ( 1 duplicates 0 deltas of 0 attempts)
trees : 0 ( 0 duplicates 0 deltas of 0 attempts)
commits: 0 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 0 ( 0 loads )
marks: 1024 ( 3 unique )
atoms: 0
Memory total: 2399 KiB
pools: 2048 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 1
pack_report: pack_mmap_calls = 1
pack_report: pack_open_windows = 1 / 1
pack_report: pack_mapped = 44 / 44
---------------------------------------------------------------------
++ test_cmp expect io.marks
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect io.marks
++ git fast-import --import-marks-if-exists=not_io.marks --export-marks=io.marks --allow-unsafe-features
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 0 ( 0 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 0 ( 0 duplicates 0 deltas of 0 attempts)
commits: 0 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 0 ( 0 loads )
marks: 1024 ( 0 unique )
atoms: 0
Memory total: 2399 KiB
pools: 2048 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 0
pack_report: core.packedGitLimit = 0
pack_report: pack_used_ctr = 0
pack_report: pack_mmap_calls = 0
pack_report: pack_open_windows = 0 / 0
pack_report: pack_mapped = 0 / 0
---------------------------------------------------------------------
++ test_must_be_empty io.marks
++ test 1 -ne 1
++ test_path_is_file io.marks
++ test 1 -ne 1
++ test -f io.marks
++ test -s io.marks
ok 139 - R: feature import-marks-if-exists
expecting success of 9300.140 'R: import to output marks works without any content':
cat >input <<-EOF &&
feature import-marks=marks.out
feature export-marks=marks.new
EOF
git fast-import --allow-unsafe-features <input &&
test_cmp marks.out marks.new
++ cat
++ git fast-import --allow-unsafe-features
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 0 ( 0 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 0 ( 0 duplicates 0 deltas of 0 attempts)
commits: 0 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 0 ( 0 loads )
marks: 1024 ( 7 unique )
atoms: 0
Memory total: 2399 KiB
pools: 2048 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 6
pack_report: pack_mmap_calls = 1
pack_report: pack_open_windows = 1 / 1
pack_report: pack_mapped = 8039 / 8039
---------------------------------------------------------------------
++ test_cmp marks.out marks.new
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u marks.out marks.new
ok 140 - R: import to output marks works without any content
expecting success of 9300.141 'R: import marks prefers commandline marks file over the stream':
cat >input <<-EOF &&
feature import-marks=nonexistent.marks
feature export-marks=marks.new
EOF
git fast-import --import-marks=marks.out --allow-unsafe-features <input &&
test_cmp marks.out marks.new
++ cat
++ git fast-import --import-marks=marks.out --allow-unsafe-features
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 0 ( 0 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 0 ( 0 duplicates 0 deltas of 0 attempts)
commits: 0 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 0 ( 0 loads )
marks: 1024 ( 7 unique )
atoms: 0
Memory total: 2399 KiB
pools: 2048 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 6
pack_report: pack_mmap_calls = 1
pack_report: pack_open_windows = 1 / 1
pack_report: pack_mapped = 8039 / 8039
---------------------------------------------------------------------
++ test_cmp marks.out marks.new
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u marks.out marks.new
ok 141 - R: import marks prefers commandline marks file over the stream
expecting success of 9300.142 'R: multiple --import-marks= should be honoured':
cat >input <<-EOF &&
feature import-marks=nonexistent.marks
feature export-marks=combined.marks
EOF
head -n2 marks.out > one.marks &&
tail -n +3 marks.out > two.marks &&
git fast-import --import-marks=one.marks --import-marks=two.marks \
--allow-unsafe-features <input &&
test_cmp marks.out combined.marks
++ cat
++ head -n2 marks.out
++ tail -n +3 marks.out
++ git fast-import --import-marks=one.marks --import-marks=two.marks --allow-unsafe-features
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 0 ( 0 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 0 ( 0 duplicates 0 deltas of 0 attempts)
commits: 0 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 0 ( 0 loads )
marks: 1024 ( 7 unique )
atoms: 0
Memory total: 2399 KiB
pools: 2048 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 6
pack_report: pack_mmap_calls = 1
pack_report: pack_open_windows = 1 / 1
pack_report: pack_mapped = 8039 / 8039
---------------------------------------------------------------------
++ test_cmp marks.out combined.marks
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u marks.out combined.marks
ok 142 - R: multiple --import-marks= should be honoured
expecting success of 9300.143 'R: feature relative-marks should be honoured':
cat >input <<-EOF &&
feature relative-marks
feature import-marks=relative.in
feature export-marks=relative.out
EOF
mkdir -p .git/info/fast-import/ &&
cp marks.new .git/info/fast-import/relative.in &&
git fast-import --allow-unsafe-features <input &&
test_cmp marks.new .git/info/fast-import/relative.out
++ cat
++ mkdir -p .git/info/fast-import/
++ cp marks.new .git/info/fast-import/relative.in
++ git fast-import --allow-unsafe-features
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 0 ( 0 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 0 ( 0 duplicates 0 deltas of 0 attempts)
commits: 0 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 0 ( 0 loads )
marks: 1024 ( 7 unique )
atoms: 0
Memory total: 2399 KiB
pools: 2048 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 6
pack_report: pack_mmap_calls = 1
pack_report: pack_open_windows = 1 / 1
pack_report: pack_mapped = 8039 / 8039
---------------------------------------------------------------------
++ test_cmp marks.new .git/info/fast-import/relative.out
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u marks.new .git/info/fast-import/relative.out
ok 143 - R: feature relative-marks should be honoured
expecting success of 9300.144 'R: feature no-relative-marks should be honoured':
cat >input <<-EOF &&
feature relative-marks
feature import-marks=relative.in
feature no-relative-marks
feature export-marks=non-relative.out
EOF
git fast-import --allow-unsafe-features <input &&
test_cmp marks.new non-relative.out
++ cat
++ git fast-import --allow-unsafe-features
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 0 ( 0 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 0 ( 0 duplicates 0 deltas of 0 attempts)
commits: 0 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 0 ( 0 loads )
marks: 1024 ( 7 unique )
atoms: 0
Memory total: 2399 KiB
pools: 2048 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 6
pack_report: pack_mmap_calls = 1
pack_report: pack_open_windows = 1 / 1
pack_report: pack_mapped = 8039 / 8039
---------------------------------------------------------------------
++ test_cmp marks.new non-relative.out
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u marks.new non-relative.out
ok 144 - R: feature no-relative-marks should be honoured
expecting success of 9300.145 'R: feature ls supported':
echo "feature ls" |
git fast-import
++ echo 'feature ls'
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 0 ( 0 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 0 ( 0 duplicates 0 deltas of 0 attempts)
commits: 0 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 0 ( 0 loads )
marks: 1024 ( 0 unique )
atoms: 0
Memory total: 2399 KiB
pools: 2048 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 0
pack_report: core.packedGitLimit = 0
pack_report: pack_used_ctr = 0
pack_report: pack_mmap_calls = 0
pack_report: pack_open_windows = 0 / 0
pack_report: pack_mapped = 0 / 0
---------------------------------------------------------------------
ok 145 - R: feature ls supported
expecting success of 9300.146 'R: feature cat-blob supported':
echo "feature cat-blob" |
git fast-import
++ echo 'feature cat-blob'
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 0 ( 0 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 0 ( 0 duplicates 0 deltas of 0 attempts)
commits: 0 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 0 ( 0 loads )
marks: 1024 ( 0 unique )
atoms: 0
Memory total: 2399 KiB
pools: 2048 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 0
pack_report: core.packedGitLimit = 0
pack_report: pack_used_ctr = 0
pack_report: pack_mmap_calls = 0
pack_report: pack_open_windows = 0 / 0
pack_report: pack_mapped = 0 / 0
---------------------------------------------------------------------
ok 146 - R: feature cat-blob supported
expecting success of 9300.147 'R: cat-blob-fd must be a nonnegative integer':
test_must_fail git fast-import --cat-blob-fd=-1 </dev/null
++ test_must_fail git fast-import --cat-blob-fd=-1
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import --cat-blob-fd=-1
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import --cat-blob-fd=-1
fatal: --cat-blob-fd: argument must be a non-negative integer
fast-import: dumping crash report to .git/fast_import_crash_1944214
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
ok 147 - R: cat-blob-fd must be a nonnegative integer
expecting success of 9300.148 'R: print old blob':
blob=$(echo "yes it can" | git hash-object -w --stdin) &&
cat >expect <<-EOF &&
${blob} blob 11
yes it can
EOF
echo "cat-blob $blob" |
git fast-import --cat-blob-fd=6 6>actual &&
test_cmp expect actual
+++ echo 'yes it can'
+++ git hash-object -w --stdin
++ blob=94fff5ffe7f8d35bcdbc60b8bf14aa97f1b282b1
++ cat
++ echo 'cat-blob 94fff5ffe7f8d35bcdbc60b8bf14aa97f1b282b1'
++ git fast-import --cat-blob-fd=6
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 0 ( 0 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 0 ( 0 duplicates 0 deltas of 0 attempts)
commits: 0 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 0 ( 0 loads )
marks: 1024 ( 0 unique )
atoms: 0
Memory total: 2399 KiB
pools: 2048 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 0
pack_report: pack_mmap_calls = 0
pack_report: pack_open_windows = 0 / 0
pack_report: pack_mapped = 0 / 0
---------------------------------------------------------------------
++ test_cmp expect actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual
ok 148 - R: print old blob
expecting success of 9300.149 'R: in-stream cat-blob-fd not respected':
echo hello >greeting &&
blob=$(git hash-object -w greeting) &&
cat >expect <<-EOF &&
${blob} blob 6
hello
EOF
git fast-import --cat-blob-fd=3 3>actual.3 >actual.1 <<-EOF &&
cat-blob $blob
EOF
test_cmp expect actual.3 &&
test_must_be_empty actual.1 &&
git fast-import 3>actual.3 >actual.1 <<-EOF &&
option cat-blob-fd=3
cat-blob $blob
EOF
test_must_be_empty actual.3 &&
test_cmp expect actual.1
++ echo hello
+++ git hash-object -w greeting
++ blob=ce013625030ba8dba906f756967f9e9ca394464a
++ cat
++ git fast-import --cat-blob-fd=3
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 0 ( 0 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 0 ( 0 duplicates 0 deltas of 0 attempts)
commits: 0 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 0 ( 0 loads )
marks: 1024 ( 0 unique )
atoms: 0
Memory total: 2399 KiB
pools: 2048 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 1
pack_report: pack_mmap_calls = 1
pack_report: pack_open_windows = 1 / 1
pack_report: pack_mapped = 8039 / 8039
---------------------------------------------------------------------
++ test_cmp expect actual.3
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual.3
++ test_must_be_empty actual.1
++ test 1 -ne 1
++ test_path_is_file actual.1
++ test 1 -ne 1
++ test -f actual.1
++ test -s actual.1
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 0 ( 0 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 0 ( 0 duplicates 0 deltas of 0 attempts)
commits: 0 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 0 ( 0 loads )
marks: 1024 ( 0 unique )
atoms: 0
Memory total: 2399 KiB
pools: 2048 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 1
pack_report: pack_mmap_calls = 1
pack_report: pack_open_windows = 1 / 1
pack_report: pack_mapped = 8039 / 8039
---------------------------------------------------------------------
++ test_must_be_empty actual.3
++ test 1 -ne 1
++ test_path_is_file actual.3
++ test 1 -ne 1
++ test -f actual.3
++ test -s actual.3
++ test_cmp expect actual.1
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual.1
ok 149 - R: in-stream cat-blob-fd not respected
expecting success of 9300.150 'R: print mark for new blob':
echo "effluentish" | git hash-object --stdin >expect &&
git fast-import --cat-blob-fd=6 6>actual <<-\EOF &&
blob
mark :1
data <<BLOB_END
effluentish
BLOB_END
get-mark :1
EOF
test_cmp expect actual
++ echo effluentish
++ git hash-object --stdin
++ git fast-import --cat-blob-fd=6
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 1 ( 0 duplicates )
blobs : 1 ( 0 duplicates 0 deltas of 0 attempts)
trees : 0 ( 0 duplicates 0 deltas of 0 attempts)
commits: 0 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 0 ( 0 loads )
marks: 1024 ( 1 unique )
atoms: 0
Memory total: 2399 KiB
pools: 2048 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 0
pack_report: pack_mmap_calls = 0
pack_report: pack_open_windows = 0 / 0
pack_report: pack_mapped = 0 / 0
---------------------------------------------------------------------
++ test_cmp expect actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual
ok 150 - R: print mark for new blob
expecting success of 9300.151 'R: print new blob':
blob=$(echo "yep yep yep" | git hash-object --stdin) &&
cat >expect <<-EOF &&
${blob} blob 12
yep yep yep
EOF
git fast-import --cat-blob-fd=6 6>actual <<-\EOF &&
blob
mark :1
data <<BLOB_END
yep yep yep
BLOB_END
cat-blob :1
EOF
test_cmp expect actual
+++ echo 'yep yep yep'
+++ git hash-object --stdin
++ blob=4ad8163546218d0de10a1e3abe0c2f295300b183
++ cat
++ git fast-import --cat-blob-fd=6
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 1 ( 0 duplicates )
blobs : 1 ( 0 duplicates 0 deltas of 0 attempts)
trees : 0 ( 0 duplicates 0 deltas of 0 attempts)
commits: 0 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 0 ( 0 loads )
marks: 1024 ( 1 unique )
atoms: 0
Memory total: 2399 KiB
pools: 2048 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 1
pack_report: pack_mmap_calls = 1
pack_report: pack_open_windows = 0 / 1
pack_report: pack_mapped = 0 / 48
---------------------------------------------------------------------
++ test_cmp expect actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual
ok 151 - R: print new blob
expecting success of 9300.152 'R: print new blob by sha1':
blob=$(echo "a new blob named by sha1" | git hash-object --stdin) &&
cat >expect <<-EOF &&
${blob} blob 25
a new blob named by sha1
EOF
git fast-import --cat-blob-fd=6 6>actual <<-EOF &&
blob
data <<BLOB_END
a new blob named by sha1
BLOB_END
cat-blob $blob
EOF
test_cmp expect actual
+++ echo 'a new blob named by sha1'
+++ git hash-object --stdin
++ blob=d07bed9d27b51babea02317fd12ddf0e27da2c52
++ cat
++ git fast-import --cat-blob-fd=6
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 1 ( 0 duplicates )
blobs : 1 ( 0 duplicates 0 deltas of 0 attempts)
trees : 0 ( 0 duplicates 0 deltas of 0 attempts)
commits: 0 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 0 ( 0 loads )
marks: 1024 ( 0 unique )
atoms: 0
Memory total: 2399 KiB
pools: 2048 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 1
pack_report: pack_mmap_calls = 1
pack_report: pack_open_windows = 0 / 1
pack_report: pack_mapped = 0 / 67
---------------------------------------------------------------------
++ test_cmp expect actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual
ok 152 - R: print new blob by sha1
expecting success of 9300.153 'setup: big file':
(
echo "the quick brown fox jumps over the lazy dog" >big &&
for i in 1 2 3
do
cat big big big big >bigger &&
cat bigger bigger bigger bigger >big ||
exit
done
)
++ echo 'the quick brown fox jumps over the lazy dog'
++ for i in 1 2 3
++ cat big big big big
++ cat bigger bigger bigger bigger
++ for i in 1 2 3
++ cat big big big big
++ cat bigger bigger bigger bigger
++ for i in 1 2 3
++ cat big big big big
++ cat bigger bigger bigger bigger
ok 153 - setup: big file
expecting success of 9300.154 'R: print two blobs to stdout':
blob1=$(git hash-object big) &&
blob1_len=$(wc -c <big) &&
blob2=$(echo hello | git hash-object --stdin) &&
{
echo ${blob1} blob $blob1_len &&
cat big &&
cat <<-EOF
${blob2} blob 6
hello
EOF
} >expect &&
{
cat <<-\END_PART1 &&
blob
mark :1
data <<data_end
END_PART1
cat big &&
cat <<-\EOF
data_end
blob
mark :2
data <<data_end
hello
data_end
cat-blob :1
cat-blob :2
EOF
} |
git fast-import >actual &&
test_cmp expect actual
+++ git hash-object big
++ blob1=8caa91e9dd3846af09ffc29a91cfa7226abdf588
+++ wc -c
++ blob1_len=180224
+++ git hash-object --stdin
+++ echo hello
++ blob2=ce013625030ba8dba906f756967f9e9ca394464a
++ echo 8caa91e9dd3846af09ffc29a91cfa7226abdf588 blob 180224
++ cat big
++ cat
++ cat
++ git fast-import
++ cat big
++ cat
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 1 ( 1 duplicates )
blobs : 1 ( 1 duplicates 0 deltas of 0 attempts)
trees : 0 ( 0 duplicates 0 deltas of 0 attempts)
commits: 0 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 0 ( 0 loads )
marks: 1024 ( 2 unique )
atoms: 0
Memory total: 2399 KiB
pools: 2048 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 2
pack_report: pack_mmap_calls = 2
pack_report: pack_open_windows = 1 / 2
pack_report: pack_mapped = 8039 / 8664
---------------------------------------------------------------------
++ test_cmp expect actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual
ok 154 - R: print two blobs to stdout
expecting success of 9300.155 'R: copy using cat-file':
expect_id=$(git hash-object big) &&
expect_len=$(wc -c <big) &&
echo $expect_id blob $expect_len >expect.response &&
rm -f blobs &&
mkfifo blobs &&
(
export GIT_COMMITTER_NAME GIT_COMMITTER_EMAIL GIT_COMMITTER_DATE &&
cat <<-\EOF &&
feature cat-blob
blob
mark :1
data <<BLOB
EOF
cat big &&
cat <<-\EOF &&
BLOB
cat-blob :1
EOF
read blob_id type size <&3 &&
echo "$blob_id $type $size" >response &&
test_copy_bytes $size >blob <&3 &&
read newline <&3 &&
cat <<-EOF &&
commit refs/heads/copied
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
copy big file as file3
COMMIT
M 644 inline file3
data <<BLOB
EOF
cat blob &&
echo BLOB
) 3<blobs |
git fast-import --cat-blob-fd=3 3>blobs &&
git show copied:file3 >actual &&
test_cmp expect.response response &&
test_cmp big actual
+++ git hash-object big
++ expect_id=8caa91e9dd3846af09ffc29a91cfa7226abdf588
+++ wc -c
++ expect_len=180224
++ echo 8caa91e9dd3846af09ffc29a91cfa7226abdf588 blob 180224
++ rm -f blobs
++ mkfifo blobs
++ git fast-import --cat-blob-fd=3
++ export GIT_COMMITTER_NAME GIT_COMMITTER_EMAIL GIT_COMMITTER_DATE
++ cat
++ cat big
++ cat
++ read blob_id type size
++ echo '8caa91e9dd3846af09ffc29a91cfa7226abdf588 blob 180224'
++ test_copy_bytes 180224
++ dd ibs=1 count=180224
++ read newline
++ cat
++ cat blob
++ echo BLOB
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 2 ( 2 duplicates )
blobs : 0 ( 2 duplicates 0 deltas of 0 attempts)
trees : 1 ( 0 duplicates 0 deltas of 0 attempts)
commits: 1 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 1 unique )
atoms: 1
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 3
pack_report: pack_mmap_calls = 2
pack_report: pack_open_windows = 2 / 2
pack_report: pack_mapped = 830 / 830
---------------------------------------------------------------------
++ git show copied:file3
++ test_cmp expect.response response
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect.response response
++ test_cmp big actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u big actual
ok 155 - R: copy using cat-file
expecting success of 9300.156 'R: print blob mid-commit':
rm -f blobs &&
echo "A blob from _before_ the commit." >expect &&
mkfifo blobs &&
(
exec 3<blobs &&
cat <<-EOF &&
feature cat-blob
blob
mark :1
data <<BLOB
A blob from _before_ the commit.
BLOB
commit refs/heads/temporary
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
Empty commit
COMMIT
cat-blob :1
EOF
read blob_id type size <&3 &&
test_copy_bytes $size >actual <&3 &&
read newline <&3 &&
echo
) |
git fast-import --cat-blob-fd=3 3>blobs &&
test_cmp expect actual
++ rm -f blobs
++ echo 'A blob from _before_ the commit.'
++ mkfifo blobs
++ exec
++ git fast-import --cat-blob-fd=3
++ cat
++ read blob_id type size
++ test_copy_bytes 33
++ dd ibs=1 count=33
++ read newline
++ echo
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 2 ( 1 duplicates )
blobs : 1 ( 0 duplicates 0 deltas of 0 attempts)
trees : 0 ( 1 duplicates 0 deltas of 0 attempts)
commits: 1 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 1 unique )
atoms: 0
Memory total: 2399 KiB
pools: 2048 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 3
pack_report: pack_mmap_calls = 2
pack_report: pack_open_windows = 1 / 1
pack_report: pack_mapped = 199 / 199
---------------------------------------------------------------------
++ test_cmp expect actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual
ok 156 - R: print blob mid-commit
expecting success of 9300.157 'R: print staged blob within commit':
rm -f blobs &&
echo "A blob from _within_ the commit." >expect &&
mkfifo blobs &&
(
exec 3<blobs &&
cat <<-EOF &&
feature cat-blob
commit refs/heads/within
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
Empty commit
COMMIT
M 644 inline within
data <<BLOB
A blob from _within_ the commit.
BLOB
EOF
to_get=$(
echo "A blob from _within_ the commit." |
git hash-object --stdin
) &&
echo "cat-blob $to_get" &&
read blob_id type size <&3 &&
test_copy_bytes $size >actual <&3 &&
read newline <&3 &&
echo deleteall
) |
git fast-import --cat-blob-fd=3 3>blobs &&
test_cmp expect actual
++ rm -f blobs
++ echo 'A blob from _within_ the commit.'
++ mkfifo blobs
++ git fast-import --cat-blob-fd=3
++ exec
++ cat
+++ echo 'A blob from _within_ the commit.'
+++ git hash-object --stdin
++ to_get=50eb2b35d26f05cb6c313357eaecb48c5e9aee4e
++ echo 'cat-blob 50eb2b35d26f05cb6c313357eaecb48c5e9aee4e'
++ read blob_id type size
++ test_copy_bytes 33
++ dd ibs=1 count=33
++ read newline
++ echo deleteall
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 1 ( 2 duplicates )
blobs : 1 ( 0 duplicates 0 deltas of 0 attempts)
trees : 0 ( 1 duplicates 0 deltas of 0 attempts)
commits: 0 ( 1 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 1
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 3
pack_report: pack_mmap_calls = 2
pack_report: pack_open_windows = 1 / 1
pack_report: pack_mapped = 199 / 199
---------------------------------------------------------------------
++ test_cmp expect actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual
ok 157 - R: print staged blob within commit
expecting success of 9300.158 'R: quiet option results in no stats being output':
cat >input <<-EOF &&
option git quiet
blob
data 3
hi
EOF
git fast-import 2>output <input &&
test_must_be_empty output
++ cat
++ git fast-import
++ test_must_be_empty output
++ test 1 -ne 1
++ test_path_is_file output
++ test 1 -ne 1
++ test -f output
++ test -s output
ok 158 - R: quiet option results in no stats being output
expecting success of 9300.159 'R: feature done means terminating "done" is mandatory':
echo feature done | test_must_fail git fast-import &&
test_must_fail git fast-import --done </dev/null
++ echo feature done
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
fatal: stream ends early
fast-import: dumping crash report to .git/fast_import_crash_1944310
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_must_fail git fast-import --done
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import --done
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import --done
fatal: stream ends early
fast-import: dumping crash report to .git/fast_import_crash_1944311
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
ok 159 - R: feature done means terminating "done" is mandatory
expecting success of 9300.160 'R: terminating "done" with trailing gibberish is ok':
git fast-import <<-\EOF &&
feature done
done
trailing gibberish
EOF
git fast-import <<-\EOF
done
more trailing gibberish
EOF
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 0 ( 0 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 0 ( 0 duplicates 0 deltas of 0 attempts)
commits: 0 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 0 ( 0 loads )
marks: 1024 ( 0 unique )
atoms: 0
Memory total: 2399 KiB
pools: 2048 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 0
pack_report: core.packedGitLimit = 0
pack_report: pack_used_ctr = 0
pack_report: pack_mmap_calls = 0
pack_report: pack_open_windows = 0 / 0
pack_report: pack_mapped = 0 / 0
---------------------------------------------------------------------
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 0 ( 0 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 0 ( 0 duplicates 0 deltas of 0 attempts)
commits: 0 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 0 ( 0 loads )
marks: 1024 ( 0 unique )
atoms: 0
Memory total: 2399 KiB
pools: 2048 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 0
pack_report: core.packedGitLimit = 0
pack_report: pack_used_ctr = 0
pack_report: pack_mmap_calls = 0
pack_report: pack_open_windows = 0 / 0
pack_report: pack_mapped = 0 / 0
---------------------------------------------------------------------
ok 160 - R: terminating "done" with trailing gibberish is ok
expecting success of 9300.161 'R: terminating "done" within commit':
cat >expect <<-\EOF &&
OBJID
:000000 100644 OBJID OBJID A hello.c
:000000 100644 OBJID OBJID A hello2.c
EOF
git fast-import <<-EOF &&
commit refs/heads/done-ends
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<EOT
Commit terminated by "done" command
EOT
M 100644 inline hello.c
data <<EOT
Hello, world.
EOT
C hello.c hello2.c
done
EOF
git rev-list done-ends |
git diff-tree -r --stdin --root --always |
sed -e "s/$OID_REGEX/OBJID/g" >actual &&
test_cmp expect actual
++ cat
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 3 ( 0 duplicates )
blobs : 1 ( 0 duplicates 0 deltas of 0 attempts)
trees : 1 ( 0 duplicates 0 deltas of 0 attempts)
commits: 1 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 2
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 2
pack_report: pack_mmap_calls = 1
pack_report: pack_open_windows = 1 / 1
pack_report: pack_mapped = 244 / 244
---------------------------------------------------------------------
++ git rev-list done-ends
++ git diff-tree -r --stdin --root --always
++ sed -e 's/[0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]/OBJID/g'
++ test_cmp expect actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual
ok 161 - R: terminating "done" within commit
expecting success of 9300.162 'R: die on unknown option':
cat >input <<-EOF &&
option git non-existing-option
EOF
test_must_fail git fast-import <input
++ cat
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
fatal: This version of fast-import does not support option: non-existing-option
fast-import: dumping crash report to .git/fast_import_crash_1944321
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
ok 162 - R: die on unknown option
expecting success of 9300.163 'R: unknown commandline options are rejected': \
test_must_fail git fast-import --non-existing-option < /dev/null
++ test_must_fail git fast-import --non-existing-option
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import --non-existing-option
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import --non-existing-option
fatal: unknown option --non-existing-option
fast-import: dumping crash report to .git/fast_import_crash_1944322
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
ok 163 - R: unknown commandline options are rejected
expecting success of 9300.164 'R: die on invalid option argument':
echo "option git active-branches=-5" |
test_must_fail git fast-import &&
echo "option git depth=" |
test_must_fail git fast-import &&
test_must_fail git fast-import --depth="5 elephants" </dev/null
++ echo 'option git active-branches=-5'
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
fatal: --active-branches: argument must be a non-negative integer
fast-import: dumping crash report to .git/fast_import_crash_1944325
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ echo 'option git depth='
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
fatal: --depth: argument must be a non-negative integer
fast-import: dumping crash report to .git/fast_import_crash_1944328
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_must_fail git fast-import '--depth=5 elephants'
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import '--depth=5 elephants'
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import '--depth=5 elephants'
fatal: --depth: argument must be a non-negative integer
fast-import: dumping crash report to .git/fast_import_crash_1944329
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
ok 164 - R: die on invalid option argument
expecting success of 9300.165 'R: ignore non-git options':
cat >input <<-EOF &&
option non-existing-vcs non-existing-option
EOF
git fast-import <input
++ cat
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 0 ( 0 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 0 ( 0 duplicates 0 deltas of 0 attempts)
commits: 0 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 0 ( 0 loads )
marks: 1024 ( 0 unique )
atoms: 0
Memory total: 2399 KiB
pools: 2048 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 0
pack_report: core.packedGitLimit = 0
pack_report: pack_used_ctr = 0
pack_report: pack_mmap_calls = 0
pack_report: pack_open_windows = 0 / 0
pack_report: pack_mapped = 0 / 0
---------------------------------------------------------------------
ok 165 - R: ignore non-git options
expecting success of 9300.166 'R: corrupt lines do not mess marks file':
rm -f io.marks &&
blob=$(echo hi | git hash-object --stdin) &&
cat >expect <<-EOF &&
:3 $ZERO_OID
:1 $blob
:2 $blob
EOF
cp expect io.marks &&
test_must_fail git fast-import --import-marks=io.marks --export-marks=io.marks <<-\EOF &&
EOF
test_cmp expect io.marks
++ rm -f io.marks
+++ echo hi
+++ git hash-object --stdin
++ blob=45b983be36b73c0788dc9cbcb76cbb80fc7bb057
++ cat
++ cp expect io.marks
++ test_must_fail git fast-import --import-marks=io.marks --export-marks=io.marks
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import --import-marks=io.marks --export-marks=io.marks
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import --import-marks=io.marks --export-marks=io.marks
fatal: object not found: 0000000000000000000000000000000000000000
fast-import: dumping crash report to .git/fast_import_crash_1944338
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_cmp expect io.marks
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect io.marks
ok 166 - R: corrupt lines do not mess marks file
expecting success of 9300.167 'R: blob bigger than threshold':
blobsize=$((2*1024*1024 + 53)) &&
test-tool genrandom bar $blobsize >expect &&
cat >input <<-INPUT_END &&
commit refs/heads/big-file
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
R - big file
COMMIT
M 644 inline big1
data $blobsize
INPUT_END
cat expect >>input &&
cat >>input <<-INPUT_END &&
M 644 inline big2
data $blobsize
INPUT_END
cat expect >>input &&
echo >>input &&
test_create_repo R &&
git --git-dir=R/.git config fastimport.unpackLimit 0 &&
git --git-dir=R/.git fast-import --big-file-threshold=1 <input
++ blobsize=2097205
++ test-tool genrandom bar 2097205
++ cat
++ cat expect
++ cat
++ cat expect
++ echo
++ test_create_repo R
++ git init R
Initialized empty Git repository in /var/tmp/b/git/t/trash directory.t9300-fast-import/R/.git/
++ git --git-dir=R/.git config fastimport.unpackLimit 0
++ git --git-dir=R/.git fast-import --big-file-threshold=1
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 3 ( 1 duplicates )
blobs : 1 ( 1 duplicates 0 deltas of 0 attempts)
trees : 1 ( 0 duplicates 0 deltas of 0 attempts)
commits: 1 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 2
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 2
pack_report: pack_mmap_calls = 1
pack_report: pack_open_windows = 1 / 1
pack_report: pack_mapped = 2098066 / 2098066
---------------------------------------------------------------------
ok 167 - R: blob bigger than threshold
expecting success of 9300.168 'R: verify created pack':
(
cd R &&
verify_packs -v > ../verify
)
++ cd R
++ verify_packs -v
++ for p in .git/objects/pack/*.pack
++ git verify-pack -v .git/objects/pack/pack-f205b9f2ebfdce27e7b0832726e9894d291e2e52.pack
ok 168 - R: verify created pack
expecting success of 9300.169 'R: verify written objects':
git --git-dir=R/.git cat-file blob big-file:big1 >actual &&
test_cmp_bin expect actual &&
a=$(git --git-dir=R/.git rev-parse big-file:big1) &&
b=$(git --git-dir=R/.git rev-parse big-file:big2) &&
test $a = $b
++ git --git-dir=R/.git cat-file blob big-file:big1
++ test_cmp_bin expect actual
++ test 2 -ne 2
++ cmp expect actual
+++ git --git-dir=R/.git rev-parse big-file:big1
++ a=3cf5dedb26c5fe17e22954737855f7cd82622b0e
+++ git --git-dir=R/.git rev-parse big-file:big2
++ b=3cf5dedb26c5fe17e22954737855f7cd82622b0e
++ test 3cf5dedb26c5fe17e22954737855f7cd82622b0e = 3cf5dedb26c5fe17e22954737855f7cd82622b0e
ok 169 - R: verify written objects
expecting success of 9300.170 'R: blob appears only once':
n=$(grep $a verify | wc -l) &&
test 1 = $n
+++ grep 3cf5dedb26c5fe17e22954737855f7cd82622b0e verify
+++ wc -l
++ n=1
++ test 1 = 1
ok 170 - R: blob appears only once
expecting success of 9300.171 'S: initialize for S tests':
test_tick &&
cat >input <<-INPUT_END &&
commit refs/heads/S
mark :301
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit 1
COMMIT
M 100644 inline hello.c
data <<BLOB
blob 1
BLOB
commit refs/heads/S
mark :302
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit 2
COMMIT
from :301
M 100644 inline hello.c
data <<BLOB
blob 2
BLOB
blob
mark :403
data <<BLOB
blob 3
BLOB
blob
mark :202
data <<BLOB
note 2
BLOB
INPUT_END
git fast-import --export-marks=marks <input
++ test_tick
++ test -z set
++ test_tick=1112912893
++ GIT_COMMITTER_DATE='1112912893 -0700'
++ GIT_AUTHOR_DATE='1112912893 -0700'
++ export GIT_COMMITTER_DATE GIT_AUTHOR_DATE
++ cat
++ git fast-import --export-marks=marks
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 8 ( 0 duplicates )
blobs : 4 ( 0 duplicates 0 deltas of 0 attempts)
trees : 2 ( 0 duplicates 0 deltas of 1 attempts)
commits: 2 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 4 unique )
atoms: 1
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 2
pack_report: pack_mmap_calls = 1
pack_report: pack_open_windows = 1 / 1
pack_report: pack_mapped = 455 / 455
---------------------------------------------------------------------
ok 171 - S: initialize for S tests
expecting success of 9300.172 'S: filemodify with garbage after mark must fail':
test_must_fail git fast-import --import-marks=marks <<-EOF 2>err &&
commit refs/heads/S
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit N
COMMIT
M 100644 :403x hello.c
EOF
test_grep "space after mark" err
++ test_must_fail git fast-import --import-marks=marks
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import --import-marks=marks
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import --import-marks=marks
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'space after mark' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xspace after mark'
++ test 'x!' = 'xspace after mark'
++ grep 'space after mark' err
fatal: Missing space after mark: M 100644 :403x hello.c
++ return 0
ok 172 - S: filemodify with garbage after mark must fail
expecting success of 9300.173 'S: filemodify with garbage after inline must fail':
test_must_fail git fast-import --import-marks=marks <<-EOF 2>err &&
commit refs/heads/S
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit N
COMMIT
M 100644 inlineX hello.c
data <<BLOB
inline
BLOB
EOF
test_grep "nvalid dataref" err
++ test_must_fail git fast-import --import-marks=marks
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import --import-marks=marks
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import --import-marks=marks
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'nvalid dataref' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xnvalid dataref'
++ test 'x!' = 'xnvalid dataref'
++ grep 'nvalid dataref' err
fatal: Invalid dataref: M 100644 inlineX hello.c
++ return 0
ok 173 - S: filemodify with garbage after inline must fail
expecting success of 9300.174 'S: filemodify with garbage after sha1 must fail':
sha1=$(grep :403 marks | cut -d\ -f2) &&
test_must_fail git fast-import --import-marks=marks <<-EOF 2>err &&
commit refs/heads/S
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit N
COMMIT
M 100644 ${sha1}x hello.c
EOF
test_grep "space after SHA1" err
+++ grep :403 marks
+++ cut '-d ' -f2
++ sha1=f4b9ac379fda0ad3560620918bf73440e46eeb8c
++ test_must_fail git fast-import --import-marks=marks
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import --import-marks=marks
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import --import-marks=marks
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'space after SHA1' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xspace after SHA1'
++ test 'x!' = 'xspace after SHA1'
++ grep 'space after SHA1' err
fatal: Missing space after SHA1: M 100644 f4b9ac379fda0ad3560620918bf73440e46eeb8cx hello.c
++ return 0
ok 174 - S: filemodify with garbage after sha1 must fail
expecting success of 9300.175 'S: notemodify with garbage after mark dataref must fail':
test_must_fail git fast-import --import-marks=marks <<-EOF 2>err &&
commit refs/heads/S
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit S note dataref markref
COMMIT
N :202x :302
EOF
test_grep "space after mark" err
++ test_must_fail git fast-import --import-marks=marks
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import --import-marks=marks
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import --import-marks=marks
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'space after mark' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xspace after mark'
++ test 'x!' = 'xspace after mark'
++ grep 'space after mark' err
fatal: Missing space after mark: N :202x :302
++ return 0
ok 175 - S: notemodify with garbage after mark dataref must fail
expecting success of 9300.176 'S: notemodify with garbage after inline dataref must fail':
test_must_fail git fast-import --import-marks=marks <<-EOF 2>err &&
commit refs/heads/S
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit S note dataref inline
COMMIT
N inlineX :302
data <<BLOB
note blob
BLOB
EOF
test_grep "nvalid dataref" err
++ test_must_fail git fast-import --import-marks=marks
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import --import-marks=marks
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import --import-marks=marks
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'nvalid dataref' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xnvalid dataref'
++ test 'x!' = 'xnvalid dataref'
++ grep 'nvalid dataref' err
fatal: Invalid dataref: N inlineX :302
++ return 0
ok 176 - S: notemodify with garbage after inline dataref must fail
expecting success of 9300.177 'S: notemodify with garbage after sha1 dataref must fail':
sha1=$(grep :202 marks | cut -d\ -f2) &&
test_must_fail git fast-import --import-marks=marks <<-EOF 2>err &&
commit refs/heads/S
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit S note dataref sha1
COMMIT
N ${sha1}x :302
EOF
test_grep "space after SHA1" err
+++ cut '-d ' -f2
+++ grep :202 marks
++ sha1=d2f48fdae4e23fc19cf4a8454054695714188709
++ test_must_fail git fast-import --import-marks=marks
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import --import-marks=marks
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import --import-marks=marks
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'space after SHA1' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xspace after SHA1'
++ test 'x!' = 'xspace after SHA1'
++ grep 'space after SHA1' err
fatal: Missing space after SHA1: N d2f48fdae4e23fc19cf4a8454054695714188709x :302
++ return 0
ok 177 - S: notemodify with garbage after sha1 dataref must fail
expecting success of 9300.178 'S: notemodify with garbage after mark commit-ish must fail':
test_must_fail git fast-import --import-marks=marks <<-EOF 2>err &&
commit refs/heads/Snotes
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit S note commit-ish
COMMIT
N :202 :302x
EOF
test_grep "after mark" err
++ test_must_fail git fast-import --import-marks=marks
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import --import-marks=marks
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import --import-marks=marks
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'after mark' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xafter mark'
++ test 'x!' = 'xafter mark'
++ grep 'after mark' err
fatal: Garbage after mark: N :202 :302x
++ return 0
ok 178 - S: notemodify with garbage after mark commit-ish must fail
expecting success of 9300.179 'S: from with garbage after mark must fail':
test_must_fail \
git fast-import --import-marks=marks --export-marks=marks <<-EOF 2>err &&
commit refs/heads/S2
mark :303
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit 3
COMMIT
from :301x
M 100644 :403 hello.c
EOF
# go create the commit, need it for merge test
git fast-import --import-marks=marks --export-marks=marks <<-EOF &&
commit refs/heads/S2
mark :303
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit 3
COMMIT
from :301
M 100644 :403 hello.c
EOF
# now evaluate the error
test_grep "after mark" err
++ test_must_fail git fast-import --import-marks=marks --export-marks=marks
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import --import-marks=marks --export-marks=marks
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import --import-marks=marks --export-marks=marks
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ git fast-import --import-marks=marks --export-marks=marks
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 2 ( 0 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 1 ( 0 duplicates 0 deltas of 0 attempts)
commits: 1 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 5 unique )
atoms: 1
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 8
pack_report: pack_mmap_calls = 2
pack_report: pack_open_windows = 2 / 2
pack_report: pack_mapped = 680 / 680
---------------------------------------------------------------------
++ test_grep 'after mark' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xafter mark'
++ test 'x!' = 'xafter mark'
++ grep 'after mark' err
fatal: Garbage after mark: from :301x
++ return 0
ok 179 - S: from with garbage after mark must fail
expecting success of 9300.180 'S: merge with garbage after mark must fail':
test_must_fail git fast-import --import-marks=marks <<-EOF 2>err &&
commit refs/heads/S
mark :304
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
merge 4
COMMIT
from :302
merge :303x
M 100644 :403 hello.c
EOF
test_grep "after mark" err
++ test_must_fail git fast-import --import-marks=marks
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import --import-marks=marks
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import --import-marks=marks
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'after mark' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xafter mark'
++ test 'x!' = 'xafter mark'
++ grep 'after mark' err
fatal: Garbage after mark: merge :303x
++ return 0
ok 180 - S: merge with garbage after mark must fail
expecting success of 9300.181 'S: tag with garbage after mark must fail':
test_must_fail git fast-import --import-marks=marks <<-EOF 2>err &&
tag refs/tags/Stag
from :302x
tagger $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<TAG
tag S
TAG
EOF
test_grep "after mark" err
++ test_must_fail git fast-import --import-marks=marks
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import --import-marks=marks
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import --import-marks=marks
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'after mark' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xafter mark'
++ test 'x!' = 'xafter mark'
++ grep 'after mark' err
fatal: Garbage after mark: from :302x
++ return 0
ok 181 - S: tag with garbage after mark must fail
expecting success of 9300.182 'S: cat-blob with garbage after mark must fail':
test_must_fail git fast-import --import-marks=marks <<-EOF 2>err &&
cat-blob :403x
EOF
test_grep "after mark" err
++ test_must_fail git fast-import --import-marks=marks
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import --import-marks=marks
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import --import-marks=marks
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'after mark' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xafter mark'
++ test 'x!' = 'xafter mark'
++ grep 'after mark' err
fatal: Garbage after mark: cat-blob :403x
++ return 0
ok 182 - S: cat-blob with garbage after mark must fail
expecting success of 9300.183 'S: ls with garbage after mark must fail':
test_must_fail git fast-import --import-marks=marks <<-EOF 2>err &&
ls :302x hello.c
EOF
test_grep "space after mark" err
++ test_must_fail git fast-import --import-marks=marks
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import --import-marks=marks
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import --import-marks=marks
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'space after mark' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xspace after mark'
++ test 'x!' = 'xspace after mark'
++ grep 'space after mark' err
fatal: Missing space after mark: ls :302x hello.c
++ return 0
ok 183 - S: ls with garbage after mark must fail
expecting success of 9300.184 'S: ls with garbage after sha1 must fail':
sha1=$(grep :302 marks | cut -d\ -f2) &&
test_must_fail git fast-import --import-marks=marks <<-EOF 2>err &&
ls ${sha1}x hello.c
EOF
test_grep "space after tree-ish" err
+++ grep :302 marks
+++ cut '-d ' -f2
++ sha1=09b8212d623219bb80c949d5065e559b231d90ad
++ test_must_fail git fast-import --import-marks=marks
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import --import-marks=marks
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import --import-marks=marks
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'space after tree-ish' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xspace after tree-ish'
++ test 'x!' = 'xspace after tree-ish'
++ grep 'space after tree-ish' err
fatal: Missing space after tree-ish: ls 09b8212d623219bb80c949d5065e559b231d90adx hello.c
++ return 0
ok 184 - S: ls with garbage after sha1 must fail
expecting success of 9300.185 'S: paths at EOL with quoted spaces must work':
test_when_finished "git branch -D S-path-eol" &&
git -c core.protectNTFS=false fast-import --export-marks=marks.out <<-EOF >out 2>err &&
blob
mark :401
data <<BLOB
hello world
BLOB
blob
mark :402
data <<BLOB
hallo welt
BLOB
commit refs/heads/S-path-eol
mark :301
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
initial commit
COMMIT
M 100644 :401 hello.c
commit refs/heads/S-path-eol
mark :302
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit filemodify
COMMIT
from :301
M 100644 :402 $path
commit refs/heads/S-path-eol
mark :303
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit filedelete
COMMIT
from :302
D $path
commit refs/heads/S-path-eol
mark :304
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit filecopy dest
COMMIT
from :301
C hello.c $path
commit refs/heads/S-path-eol
mark :305
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit filerename dest
COMMIT
from :301
R hello.c $path
ls :305 $path
EOF
commit_m=$(grep :302 marks.out | cut -d\ -f2) &&
commit_d=$(grep :303 marks.out | cut -d\ -f2) &&
commit_c=$(grep :304 marks.out | cut -d\ -f2) &&
commit_r=$(grep :305 marks.out | cut -d\ -f2) &&
blob1=$(grep :401 marks.out | cut -d\ -f2) &&
blob2=$(grep :402 marks.out | cut -d\ -f2) &&
(
printf "100644 blob $blob2\t$unquoted_path\n" &&
printf "100644 blob $blob1\thello.c\n"
) | sort >tree_m.exp &&
git ls-tree $commit_m | sort >tree_m.out &&
test_cmp tree_m.exp tree_m.out &&
printf "100644 blob $blob1\thello.c\n" >tree_d.exp &&
git ls-tree $commit_d >tree_d.out &&
test_cmp tree_d.exp tree_d.out &&
(
printf "100644 blob $blob1\t$unquoted_path\n" &&
printf "100644 blob $blob1\thello.c\n"
) | sort >tree_c.exp &&
git ls-tree $commit_c | sort >tree_c.out &&
test_cmp tree_c.exp tree_c.out &&
printf "100644 blob $blob1\t$unquoted_path\n" >tree_r.exp &&
git ls-tree $commit_r >tree_r.out &&
test_cmp tree_r.exp tree_r.out &&
test_cmp out tree_r.exp
++ test_when_finished 'git branch -D S-path-eol'
++ test 0 = 0
++ test_cleanup='{ git branch -D S-path-eol
} && (exit "$eval_ret"); eval_ret=$?; :'
++ git -c core.protectNTFS=false fast-import --export-marks=marks.out
+++ grep :302 marks.out
+++ cut '-d ' -f2
++ commit_m=449aaab1485d70dc6cf74ba3329de19e8063f7c8
+++ grep :303 marks.out
+++ cut '-d ' -f2
++ commit_d=1c4726308e876fc9e8f4c0bae8d553eeef583532
+++ cut '-d ' -f2
+++ grep :304 marks.out
++ commit_c=bbe769399f05cfd22907d7b286939c79d20e5869
+++ cut '-d ' -f2
+++ grep :305 marks.out
++ commit_r=0a1713ee9dc50ed53a1aed6bb662a876d9b2fc9d
+++ cut '-d ' -f2
+++ grep :401 marks.out
++ blob1=3b18e512dba79e4c8300dd08aeb37f8e728b8dad
+++ grep :402 marks.out
+++ cut '-d ' -f2
++ blob2=aaaa72b2846e9d6b4b5e951925913187569547c8
++ printf '100644 blob aaaa72b2846e9d6b4b5e951925913187569547c8\t hello world.c \n'
++ printf '100644 blob 3b18e512dba79e4c8300dd08aeb37f8e728b8dad\thello.c\n'
++ sort
++ git ls-tree 449aaab1485d70dc6cf74ba3329de19e8063f7c8
++ sort
++ test_cmp tree_m.exp tree_m.out
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u tree_m.exp tree_m.out
++ printf '100644 blob 3b18e512dba79e4c8300dd08aeb37f8e728b8dad\thello.c\n'
++ git ls-tree 1c4726308e876fc9e8f4c0bae8d553eeef583532
++ test_cmp tree_d.exp tree_d.out
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u tree_d.exp tree_d.out
++ printf '100644 blob 3b18e512dba79e4c8300dd08aeb37f8e728b8dad\t hello world.c \n'
++ sort
++ printf '100644 blob 3b18e512dba79e4c8300dd08aeb37f8e728b8dad\thello.c\n'
++ git ls-tree bbe769399f05cfd22907d7b286939c79d20e5869
++ sort
++ test_cmp tree_c.exp tree_c.out
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u tree_c.exp tree_c.out
++ printf '100644 blob 3b18e512dba79e4c8300dd08aeb37f8e728b8dad\t hello world.c \n'
++ git ls-tree 0a1713ee9dc50ed53a1aed6bb662a876d9b2fc9d
++ test_cmp tree_r.exp tree_r.out
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u tree_r.exp tree_r.out
++ test_cmp out tree_r.exp
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u out tree_r.exp
++ git branch -D S-path-eol
Deleted branch S-path-eol (was 0a1713e).
++ exit 0
++ eval_ret=0
++ :
ok 185 - S: paths at EOL with quoted spaces must work
expecting success of 9300.186 'S: paths at EOL with unquoted spaces must work':
test_when_finished "git branch -D S-path-eol" &&
git -c core.protectNTFS=false fast-import --export-marks=marks.out <<-EOF >out 2>err &&
blob
mark :401
data <<BLOB
hello world
BLOB
blob
mark :402
data <<BLOB
hallo welt
BLOB
commit refs/heads/S-path-eol
mark :301
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
initial commit
COMMIT
M 100644 :401 hello.c
commit refs/heads/S-path-eol
mark :302
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit filemodify
COMMIT
from :301
M 100644 :402 $path
commit refs/heads/S-path-eol
mark :303
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit filedelete
COMMIT
from :302
D $path
commit refs/heads/S-path-eol
mark :304
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit filecopy dest
COMMIT
from :301
C hello.c $path
commit refs/heads/S-path-eol
mark :305
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit filerename dest
COMMIT
from :301
R hello.c $path
ls :305 $path
EOF
commit_m=$(grep :302 marks.out | cut -d\ -f2) &&
commit_d=$(grep :303 marks.out | cut -d\ -f2) &&
commit_c=$(grep :304 marks.out | cut -d\ -f2) &&
commit_r=$(grep :305 marks.out | cut -d\ -f2) &&
blob1=$(grep :401 marks.out | cut -d\ -f2) &&
blob2=$(grep :402 marks.out | cut -d\ -f2) &&
(
printf "100644 blob $blob2\t$unquoted_path\n" &&
printf "100644 blob $blob1\thello.c\n"
) | sort >tree_m.exp &&
git ls-tree $commit_m | sort >tree_m.out &&
test_cmp tree_m.exp tree_m.out &&
printf "100644 blob $blob1\thello.c\n" >tree_d.exp &&
git ls-tree $commit_d >tree_d.out &&
test_cmp tree_d.exp tree_d.out &&
(
printf "100644 blob $blob1\t$unquoted_path\n" &&
printf "100644 blob $blob1\thello.c\n"
) | sort >tree_c.exp &&
git ls-tree $commit_c | sort >tree_c.out &&
test_cmp tree_c.exp tree_c.out &&
printf "100644 blob $blob1\t$unquoted_path\n" >tree_r.exp &&
git ls-tree $commit_r >tree_r.out &&
test_cmp tree_r.exp tree_r.out &&
test_cmp out tree_r.exp
++ test_when_finished 'git branch -D S-path-eol'
++ test 0 = 0
++ test_cleanup='{ git branch -D S-path-eol
} && (exit "$eval_ret"); eval_ret=$?; :'
++ git -c core.protectNTFS=false fast-import --export-marks=marks.out
+++ cut '-d ' -f2
+++ grep :302 marks.out
++ commit_m=449aaab1485d70dc6cf74ba3329de19e8063f7c8
+++ cut '-d ' -f2
+++ grep :303 marks.out
++ commit_d=1c4726308e876fc9e8f4c0bae8d553eeef583532
+++ grep :304 marks.out
+++ cut '-d ' -f2
++ commit_c=bbe769399f05cfd22907d7b286939c79d20e5869
+++ grep :305 marks.out
+++ cut '-d ' -f2
++ commit_r=0a1713ee9dc50ed53a1aed6bb662a876d9b2fc9d
+++ cut '-d ' -f2
+++ grep :401 marks.out
++ blob1=3b18e512dba79e4c8300dd08aeb37f8e728b8dad
+++ grep :402 marks.out
+++ cut '-d ' -f2
++ blob2=aaaa72b2846e9d6b4b5e951925913187569547c8
++ printf '100644 blob aaaa72b2846e9d6b4b5e951925913187569547c8\t hello world.c \n'
++ sort
++ printf '100644 blob 3b18e512dba79e4c8300dd08aeb37f8e728b8dad\thello.c\n'
++ git ls-tree 449aaab1485d70dc6cf74ba3329de19e8063f7c8
++ sort
++ test_cmp tree_m.exp tree_m.out
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u tree_m.exp tree_m.out
++ printf '100644 blob 3b18e512dba79e4c8300dd08aeb37f8e728b8dad\thello.c\n'
++ git ls-tree 1c4726308e876fc9e8f4c0bae8d553eeef583532
++ test_cmp tree_d.exp tree_d.out
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u tree_d.exp tree_d.out
++ sort
++ printf '100644 blob 3b18e512dba79e4c8300dd08aeb37f8e728b8dad\t hello world.c \n'
++ printf '100644 blob 3b18e512dba79e4c8300dd08aeb37f8e728b8dad\thello.c\n'
++ git ls-tree bbe769399f05cfd22907d7b286939c79d20e5869
++ sort
++ test_cmp tree_c.exp tree_c.out
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u tree_c.exp tree_c.out
++ printf '100644 blob 3b18e512dba79e4c8300dd08aeb37f8e728b8dad\t hello world.c \n'
++ git ls-tree 0a1713ee9dc50ed53a1aed6bb662a876d9b2fc9d
++ test_cmp tree_r.exp tree_r.out
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u tree_r.exp tree_r.out
++ test_cmp out tree_r.exp
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u out tree_r.exp
++ git branch -D S-path-eol
Deleted branch S-path-eol (was 0a1713e).
++ exit 0
++ eval_ret=0
++ :
ok 186 - S: paths at EOL with unquoted spaces must work
expecting success of 9300.187 'S: paths at EOL with octal escapes must work':
test_when_finished "git branch -D S-path-eol" &&
git -c core.protectNTFS=false fast-import --export-marks=marks.out <<-EOF >out 2>err &&
blob
mark :401
data <<BLOB
hello world
BLOB
blob
mark :402
data <<BLOB
hallo welt
BLOB
commit refs/heads/S-path-eol
mark :301
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
initial commit
COMMIT
M 100644 :401 hello.c
commit refs/heads/S-path-eol
mark :302
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit filemodify
COMMIT
from :301
M 100644 :402 $path
commit refs/heads/S-path-eol
mark :303
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit filedelete
COMMIT
from :302
D $path
commit refs/heads/S-path-eol
mark :304
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit filecopy dest
COMMIT
from :301
C hello.c $path
commit refs/heads/S-path-eol
mark :305
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit filerename dest
COMMIT
from :301
R hello.c $path
ls :305 $path
EOF
commit_m=$(grep :302 marks.out | cut -d\ -f2) &&
commit_d=$(grep :303 marks.out | cut -d\ -f2) &&
commit_c=$(grep :304 marks.out | cut -d\ -f2) &&
commit_r=$(grep :305 marks.out | cut -d\ -f2) &&
blob1=$(grep :401 marks.out | cut -d\ -f2) &&
blob2=$(grep :402 marks.out | cut -d\ -f2) &&
(
printf "100644 blob $blob2\t$unquoted_path\n" &&
printf "100644 blob $blob1\thello.c\n"
) | sort >tree_m.exp &&
git ls-tree $commit_m | sort >tree_m.out &&
test_cmp tree_m.exp tree_m.out &&
printf "100644 blob $blob1\thello.c\n" >tree_d.exp &&
git ls-tree $commit_d >tree_d.out &&
test_cmp tree_d.exp tree_d.out &&
(
printf "100644 blob $blob1\t$unquoted_path\n" &&
printf "100644 blob $blob1\thello.c\n"
) | sort >tree_c.exp &&
git ls-tree $commit_c | sort >tree_c.out &&
test_cmp tree_c.exp tree_c.out &&
printf "100644 blob $blob1\t$unquoted_path\n" >tree_r.exp &&
git ls-tree $commit_r >tree_r.out &&
test_cmp tree_r.exp tree_r.out &&
test_cmp out tree_r.exp
++ test_when_finished 'git branch -D S-path-eol'
++ test 0 = 0
++ test_cleanup='{ git branch -D S-path-eol
} && (exit "$eval_ret"); eval_ret=$?; :'
++ git -c core.protectNTFS=false fast-import --export-marks=marks.out
+++ grep :302 marks.out
+++ cut '-d ' -f2
++ commit_m=05de6f81bac2beff8e2811a57bbd91020cd2ef75
+++ grep :303 marks.out
+++ cut '-d ' -f2
++ commit_d=5fdb43d7d6abc534127beef7ad44ef585bcbfcf3
+++ grep :304 marks.out
+++ cut '-d ' -f2
++ commit_c=6239a20b7cc1a6d40070a8015b60e5ae3ff0c951
+++ cut '-d ' -f2
+++ grep :305 marks.out
++ commit_r=82813b89adcc7de16d63c1f30f3b8b51414f5ed8
+++ grep :401 marks.out
+++ cut '-d ' -f2
++ blob1=3b18e512dba79e4c8300dd08aeb37f8e728b8dad
+++ grep :402 marks.out
+++ cut '-d ' -f2
++ blob2=aaaa72b2846e9d6b4b5e951925913187569547c8
++ sort
++ printf '100644 blob aaaa72b2846e9d6b4b5e951925913187569547c8\thi.c\n'
++ printf '100644 blob 3b18e512dba79e4c8300dd08aeb37f8e728b8dad\thello.c\n'
++ git ls-tree 05de6f81bac2beff8e2811a57bbd91020cd2ef75
++ sort
++ test_cmp tree_m.exp tree_m.out
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u tree_m.exp tree_m.out
++ printf '100644 blob 3b18e512dba79e4c8300dd08aeb37f8e728b8dad\thello.c\n'
++ git ls-tree 5fdb43d7d6abc534127beef7ad44ef585bcbfcf3
++ test_cmp tree_d.exp tree_d.out
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u tree_d.exp tree_d.out
++ sort
++ printf '100644 blob 3b18e512dba79e4c8300dd08aeb37f8e728b8dad\thi.c\n'
++ printf '100644 blob 3b18e512dba79e4c8300dd08aeb37f8e728b8dad\thello.c\n'
++ git ls-tree 6239a20b7cc1a6d40070a8015b60e5ae3ff0c951
++ sort
++ test_cmp tree_c.exp tree_c.out
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u tree_c.exp tree_c.out
++ printf '100644 blob 3b18e512dba79e4c8300dd08aeb37f8e728b8dad\thi.c\n'
++ git ls-tree 82813b89adcc7de16d63c1f30f3b8b51414f5ed8
++ test_cmp tree_r.exp tree_r.out
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u tree_r.exp tree_r.out
++ test_cmp out tree_r.exp
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u out tree_r.exp
++ git branch -D S-path-eol
Deleted branch S-path-eol (was 82813b8).
++ exit 0
++ eval_ret=0
++ :
ok 187 - S: paths at EOL with octal escapes must work
expecting success of 9300.188 'S: paths before space with quoted spaces must work':
test_when_finished "git branch -D S-path-space" &&
git -c core.protectNTFS=false fast-import --export-marks=marks.out <<-EOF 2>err &&
blob
mark :401
data <<BLOB
hello world
BLOB
commit refs/heads/S-path-space
mark :301
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
initial commit
COMMIT
M 100644 :401 $path
commit refs/heads/S-path-space
mark :302
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit filecopy source
COMMIT
from :301
C $path hello2.c
commit refs/heads/S-path-space
mark :303
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit filerename source
COMMIT
from :301
R $path hello2.c
EOF
commit_c=$(grep :302 marks.out | cut -d\ -f2) &&
commit_r=$(grep :303 marks.out | cut -d\ -f2) &&
blob=$(grep :401 marks.out | cut -d\ -f2) &&
(
printf "100644 blob $blob\t$unquoted_path\n" &&
printf "100644 blob $blob\thello2.c\n"
) | sort >tree_c.exp &&
git ls-tree $commit_c | sort >tree_c.out &&
test_cmp tree_c.exp tree_c.out &&
printf "100644 blob $blob\thello2.c\n" >tree_r.exp &&
git ls-tree $commit_r >tree_r.out &&
test_cmp tree_r.exp tree_r.out
++ test_when_finished 'git branch -D S-path-space'
++ test 0 = 0
++ test_cleanup='{ git branch -D S-path-space
} && (exit "$eval_ret"); eval_ret=$?; :'
++ git -c core.protectNTFS=false fast-import --export-marks=marks.out
+++ grep :302 marks.out
+++ cut '-d ' -f2
++ commit_c=a1a532d347accd7e3bc0fc08ce5bd6cef5a70c1f
+++ grep :303 marks.out
+++ cut '-d ' -f2
++ commit_r=c2460f33584a082d80cac2a490799404d2bee80c
+++ grep :401 marks.out
+++ cut '-d ' -f2
++ blob=3b18e512dba79e4c8300dd08aeb37f8e728b8dad
++ printf '100644 blob 3b18e512dba79e4c8300dd08aeb37f8e728b8dad\t hello world.c \n'
++ printf '100644 blob 3b18e512dba79e4c8300dd08aeb37f8e728b8dad\thello2.c\n'
++ sort
++ git ls-tree a1a532d347accd7e3bc0fc08ce5bd6cef5a70c1f
++ sort
++ test_cmp tree_c.exp tree_c.out
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u tree_c.exp tree_c.out
++ printf '100644 blob 3b18e512dba79e4c8300dd08aeb37f8e728b8dad\thello2.c\n'
++ git ls-tree c2460f33584a082d80cac2a490799404d2bee80c
++ test_cmp tree_r.exp tree_r.out
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u tree_r.exp tree_r.out
++ git branch -D S-path-space
Deleted branch S-path-space (was c2460f3).
++ exit 0
++ eval_ret=0
++ :
ok 188 - S: paths before space with quoted spaces must work
expecting success of 9300.189 'S: paths before space with no unquoted spaces must work':
test_when_finished "git branch -D S-path-space" &&
git -c core.protectNTFS=false fast-import --export-marks=marks.out <<-EOF 2>err &&
blob
mark :401
data <<BLOB
hello world
BLOB
commit refs/heads/S-path-space
mark :301
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
initial commit
COMMIT
M 100644 :401 $path
commit refs/heads/S-path-space
mark :302
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit filecopy source
COMMIT
from :301
C $path hello2.c
commit refs/heads/S-path-space
mark :303
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit filerename source
COMMIT
from :301
R $path hello2.c
EOF
commit_c=$(grep :302 marks.out | cut -d\ -f2) &&
commit_r=$(grep :303 marks.out | cut -d\ -f2) &&
blob=$(grep :401 marks.out | cut -d\ -f2) &&
(
printf "100644 blob $blob\t$unquoted_path\n" &&
printf "100644 blob $blob\thello2.c\n"
) | sort >tree_c.exp &&
git ls-tree $commit_c | sort >tree_c.out &&
test_cmp tree_c.exp tree_c.out &&
printf "100644 blob $blob\thello2.c\n" >tree_r.exp &&
git ls-tree $commit_r >tree_r.out &&
test_cmp tree_r.exp tree_r.out
++ test_when_finished 'git branch -D S-path-space'
++ test 0 = 0
++ test_cleanup='{ git branch -D S-path-space
} && (exit "$eval_ret"); eval_ret=$?; :'
++ git -c core.protectNTFS=false fast-import --export-marks=marks.out
+++ grep :302 marks.out
+++ cut '-d ' -f2
++ commit_c=327b30126013f01ba8fa2e91760c1cf75cea578d
+++ grep :303 marks.out
+++ cut '-d ' -f2
++ commit_r=a90281449d836d82b7942046e90850438864c41d
+++ grep :401 marks.out
+++ cut '-d ' -f2
++ blob=3b18e512dba79e4c8300dd08aeb37f8e728b8dad
++ printf '100644 blob 3b18e512dba79e4c8300dd08aeb37f8e728b8dad\thello_world.c\n'
++ printf '100644 blob 3b18e512dba79e4c8300dd08aeb37f8e728b8dad\thello2.c\n'
++ sort
++ sort
++ git ls-tree 327b30126013f01ba8fa2e91760c1cf75cea578d
++ test_cmp tree_c.exp tree_c.out
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u tree_c.exp tree_c.out
++ printf '100644 blob 3b18e512dba79e4c8300dd08aeb37f8e728b8dad\thello2.c\n'
++ git ls-tree a90281449d836d82b7942046e90850438864c41d
++ test_cmp tree_r.exp tree_r.out
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u tree_r.exp tree_r.out
++ git branch -D S-path-space
Deleted branch S-path-space (was a902814).
++ exit 0
++ eval_ret=0
++ :
ok 189 - S: paths before space with no unquoted spaces must work
expecting success of 9300.190 'S: paths before space with octal escapes must work':
test_when_finished "git branch -D S-path-space" &&
git -c core.protectNTFS=false fast-import --export-marks=marks.out <<-EOF 2>err &&
blob
mark :401
data <<BLOB
hello world
BLOB
commit refs/heads/S-path-space
mark :301
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
initial commit
COMMIT
M 100644 :401 $path
commit refs/heads/S-path-space
mark :302
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit filecopy source
COMMIT
from :301
C $path hello2.c
commit refs/heads/S-path-space
mark :303
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit filerename source
COMMIT
from :301
R $path hello2.c
EOF
commit_c=$(grep :302 marks.out | cut -d\ -f2) &&
commit_r=$(grep :303 marks.out | cut -d\ -f2) &&
blob=$(grep :401 marks.out | cut -d\ -f2) &&
(
printf "100644 blob $blob\t$unquoted_path\n" &&
printf "100644 blob $blob\thello2.c\n"
) | sort >tree_c.exp &&
git ls-tree $commit_c | sort >tree_c.out &&
test_cmp tree_c.exp tree_c.out &&
printf "100644 blob $blob\thello2.c\n" >tree_r.exp &&
git ls-tree $commit_r >tree_r.out &&
test_cmp tree_r.exp tree_r.out
++ test_when_finished 'git branch -D S-path-space'
++ test 0 = 0
++ test_cleanup='{ git branch -D S-path-space
} && (exit "$eval_ret"); eval_ret=$?; :'
++ git -c core.protectNTFS=false fast-import --export-marks=marks.out
+++ grep :302 marks.out
+++ cut '-d ' -f2
++ commit_c=9f5da9dd02437015bebff483801ab41aecd4d23f
+++ grep :303 marks.out
+++ cut '-d ' -f2
++ commit_r=73044424dd7fed18afc8d64b32b63a44d167e137
+++ grep :401 marks.out
+++ cut '-d ' -f2
++ blob=3b18e512dba79e4c8300dd08aeb37f8e728b8dad
++ printf '100644 blob 3b18e512dba79e4c8300dd08aeb37f8e728b8dad\thi.c\n'
++ printf '100644 blob 3b18e512dba79e4c8300dd08aeb37f8e728b8dad\thello2.c\n'
++ sort
++ sort
++ git ls-tree 9f5da9dd02437015bebff483801ab41aecd4d23f
++ test_cmp tree_c.exp tree_c.out
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u tree_c.exp tree_c.out
++ printf '100644 blob 3b18e512dba79e4c8300dd08aeb37f8e728b8dad\thello2.c\n'
++ git ls-tree 73044424dd7fed18afc8d64b32b63a44d167e137
++ test_cmp tree_r.exp tree_r.out
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u tree_r.exp tree_r.out
++ git branch -D S-path-space
Deleted branch S-path-space (was 7304442).
++ exit 0
++ eval_ret=0
++ :
ok 190 - S: paths before space with octal escapes must work
expecting success of 9300.191 'S: filemodify with unclosed " in path must fail':
test_must_fail git fast-import <<-EOF 2>err &&
blob
mark :1
data <<BLOB
hello world
BLOB
commit refs/heads/S-path-fail
mark :2
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit setup
COMMIT
M 100644 :1 hello.c
commit refs/heads/S-path-fail
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit with bad path
COMMIT
from :2
$prefix$path$suffix
EOF
test_grep "$err_grep" err
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'Invalid path' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xInvalid path'
++ test 'x!' = 'xInvalid path'
++ grep 'Invalid path' err
fatal: Invalid path: M 100644 :1 "hello.c
++ return 0
ok 191 - S: filemodify with unclosed " in path must fail
expecting success of 9300.192 'S: filemodify with invalid escape in quoted path must fail':
test_must_fail git fast-import <<-EOF 2>err &&
blob
mark :1
data <<BLOB
hello world
BLOB
commit refs/heads/S-path-fail
mark :2
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit setup
COMMIT
M 100644 :1 hello.c
commit refs/heads/S-path-fail
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit with bad path
COMMIT
from :2
$prefix$path$suffix
EOF
test_grep "$err_grep" err
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'Invalid path' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xInvalid path'
++ test 'x!' = 'xInvalid path'
++ grep 'Invalid path' err
fatal: Invalid path: M 100644 :1 "hello\xff"
++ return 0
ok 192 - S: filemodify with invalid escape in quoted path must fail
expecting success of 9300.193 'S: filemodify with escaped NUL in quoted path must fail':
test_must_fail git fast-import <<-EOF 2>err &&
blob
mark :1
data <<BLOB
hello world
BLOB
commit refs/heads/S-path-fail
mark :2
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit setup
COMMIT
M 100644 :1 hello.c
commit refs/heads/S-path-fail
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit with bad path
COMMIT
from :2
$prefix$path$suffix
EOF
test_grep "$err_grep" err
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'NUL in path' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xNUL in path'
++ test 'x!' = 'xNUL in path'
++ grep 'NUL in path' err
fatal: NUL in path: M 100644 :1 "hello\000"
++ return 0
ok 193 - S: filemodify with escaped NUL in quoted path must fail
expecting success of 9300.194 'S: filemodify with garbage after quoted path must fail':
test_must_fail git fast-import <<-EOF 2>err &&
blob
mark :1
data <<BLOB
hello world
BLOB
commit refs/heads/S-path-fail
mark :2
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit setup
COMMIT
M 100644 :1 hello.c
commit refs/heads/S-path-fail
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit with bad path
COMMIT
from :2
$prefix$path$suffix
EOF
test_grep "$err_grep" err
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'Garbage after path' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xGarbage after path'
++ test 'x!' = 'xGarbage after path'
++ grep 'Garbage after path' err
fatal: Garbage after path: M 100644 :1 "hello.c"x
++ return 0
ok 194 - S: filemodify with garbage after quoted path must fail
expecting success of 9300.195 'S: filemodify with space after quoted path must fail':
test_must_fail git fast-import <<-EOF 2>err &&
blob
mark :1
data <<BLOB
hello world
BLOB
commit refs/heads/S-path-fail
mark :2
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit setup
COMMIT
M 100644 :1 hello.c
commit refs/heads/S-path-fail
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit with bad path
COMMIT
from :2
$prefix$path$suffix
EOF
test_grep "$err_grep" err
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'Garbage after path' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xGarbage after path'
++ test 'x!' = 'xGarbage after path'
++ grep 'Garbage after path' err
fatal: Garbage after path: M 100644 :1 "hello.c"
++ return 0
ok 195 - S: filemodify with space after quoted path must fail
expecting success of 9300.196 'S: filedelete with unclosed " in path must fail':
test_must_fail git fast-import <<-EOF 2>err &&
blob
mark :1
data <<BLOB
hello world
BLOB
commit refs/heads/S-path-fail
mark :2
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit setup
COMMIT
M 100644 :1 hello.c
commit refs/heads/S-path-fail
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit with bad path
COMMIT
from :2
$prefix$path$suffix
EOF
test_grep "$err_grep" err
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'Invalid path' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xInvalid path'
++ test 'x!' = 'xInvalid path'
++ grep 'Invalid path' err
fatal: Invalid path: D "hello.c
++ return 0
ok 196 - S: filedelete with unclosed " in path must fail
expecting success of 9300.197 'S: filedelete with invalid escape in quoted path must fail':
test_must_fail git fast-import <<-EOF 2>err &&
blob
mark :1
data <<BLOB
hello world
BLOB
commit refs/heads/S-path-fail
mark :2
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit setup
COMMIT
M 100644 :1 hello.c
commit refs/heads/S-path-fail
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit with bad path
COMMIT
from :2
$prefix$path$suffix
EOF
test_grep "$err_grep" err
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'Invalid path' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xInvalid path'
++ test 'x!' = 'xInvalid path'
++ grep 'Invalid path' err
fatal: Invalid path: D "hello\xff"
++ return 0
ok 197 - S: filedelete with invalid escape in quoted path must fail
expecting success of 9300.198 'S: filedelete with escaped NUL in quoted path must fail':
test_must_fail git fast-import <<-EOF 2>err &&
blob
mark :1
data <<BLOB
hello world
BLOB
commit refs/heads/S-path-fail
mark :2
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit setup
COMMIT
M 100644 :1 hello.c
commit refs/heads/S-path-fail
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit with bad path
COMMIT
from :2
$prefix$path$suffix
EOF
test_grep "$err_grep" err
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'NUL in path' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xNUL in path'
++ test 'x!' = 'xNUL in path'
++ grep 'NUL in path' err
fatal: NUL in path: D "hello\000"
++ return 0
ok 198 - S: filedelete with escaped NUL in quoted path must fail
expecting success of 9300.199 'S: filedelete with garbage after quoted path must fail':
test_must_fail git fast-import <<-EOF 2>err &&
blob
mark :1
data <<BLOB
hello world
BLOB
commit refs/heads/S-path-fail
mark :2
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit setup
COMMIT
M 100644 :1 hello.c
commit refs/heads/S-path-fail
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit with bad path
COMMIT
from :2
$prefix$path$suffix
EOF
test_grep "$err_grep" err
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'Garbage after path' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xGarbage after path'
++ test 'x!' = 'xGarbage after path'
++ grep 'Garbage after path' err
fatal: Garbage after path: D "hello.c"x
++ return 0
ok 199 - S: filedelete with garbage after quoted path must fail
expecting success of 9300.200 'S: filedelete with space after quoted path must fail':
test_must_fail git fast-import <<-EOF 2>err &&
blob
mark :1
data <<BLOB
hello world
BLOB
commit refs/heads/S-path-fail
mark :2
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit setup
COMMIT
M 100644 :1 hello.c
commit refs/heads/S-path-fail
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit with bad path
COMMIT
from :2
$prefix$path$suffix
EOF
test_grep "$err_grep" err
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'Garbage after path' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xGarbage after path'
++ test 'x!' = 'xGarbage after path'
++ grep 'Garbage after path' err
fatal: Garbage after path: D "hello.c"
++ return 0
ok 200 - S: filedelete with space after quoted path must fail
expecting success of 9300.201 'S: filecopy with unclosed " in source must fail':
test_must_fail git fast-import <<-EOF 2>err &&
blob
mark :1
data <<BLOB
hello world
BLOB
commit refs/heads/S-path-fail
mark :2
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit setup
COMMIT
M 100644 :1 hello.c
commit refs/heads/S-path-fail
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit with bad path
COMMIT
from :2
$prefix$path$suffix
EOF
test_grep "$err_grep" err
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'Invalid source' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xInvalid source'
++ test 'x!' = 'xInvalid source'
++ grep 'Invalid source' err
fatal: Invalid source: C "hello.c world.c
++ return 0
ok 201 - S: filecopy with unclosed " in source must fail
expecting success of 9300.202 'S: filecopy with invalid escape in quoted source must fail':
test_must_fail git fast-import <<-EOF 2>err &&
blob
mark :1
data <<BLOB
hello world
BLOB
commit refs/heads/S-path-fail
mark :2
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit setup
COMMIT
M 100644 :1 hello.c
commit refs/heads/S-path-fail
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit with bad path
COMMIT
from :2
$prefix$path$suffix
EOF
test_grep "$err_grep" err
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'Invalid source' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xInvalid source'
++ test 'x!' = 'xInvalid source'
++ grep 'Invalid source' err
fatal: Invalid source: C "hello\xff" world.c
++ return 0
ok 202 - S: filecopy with invalid escape in quoted source must fail
expecting success of 9300.203 'S: filecopy with escaped NUL in quoted source must fail':
test_must_fail git fast-import <<-EOF 2>err &&
blob
mark :1
data <<BLOB
hello world
BLOB
commit refs/heads/S-path-fail
mark :2
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit setup
COMMIT
M 100644 :1 hello.c
commit refs/heads/S-path-fail
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit with bad path
COMMIT
from :2
$prefix$path$suffix
EOF
test_grep "$err_grep" err
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'NUL in source' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xNUL in source'
++ test 'x!' = 'xNUL in source'
++ grep 'NUL in source' err
fatal: NUL in source: C "hello\000" world.c
++ return 0
ok 203 - S: filecopy with escaped NUL in quoted source must fail
expecting success of 9300.204 'S: filecopy with missing space after quoted source must fail':
test_must_fail git fast-import <<-EOF 2>err &&
blob
mark :1
data <<BLOB
hello world
BLOB
commit refs/heads/S-path-fail
mark :2
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit setup
COMMIT
M 100644 :1 hello.c
commit refs/heads/S-path-fail
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit with bad path
COMMIT
from :2
$prefix$path$suffix
EOF
test_grep "$err_grep" err
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'Missing space after source' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xMissing space after source'
++ test 'x!' = 'xMissing space after source'
++ grep 'Missing space after source' err
fatal: Missing space after source: C "hello.c"x world.c
++ return 0
ok 204 - S: filecopy with missing space after quoted source must fail
expecting success of 9300.205 'S: filecopy with missing space after unquoted source must fail':
test_must_fail git fast-import <<-EOF 2>err &&
blob
mark :1
data <<BLOB
hello world
BLOB
commit refs/heads/S-path-fail
mark :2
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit setup
COMMIT
M 100644 :1 hello.c
commit refs/heads/S-path-fail
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit with bad path
COMMIT
from :2
$prefix$path$suffix
EOF
test_grep "$err_grep" err
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'Missing space after source' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xMissing space after source'
++ test 'x!' = 'xMissing space after source'
++ grep 'Missing space after source' err
fatal: Missing space after source: C hello.c
++ return 0
ok 205 - S: filecopy with missing space after unquoted source must fail
expecting success of 9300.206 'S: filecopy with unclosed " in dest must fail':
test_must_fail git fast-import <<-EOF 2>err &&
blob
mark :1
data <<BLOB
hello world
BLOB
commit refs/heads/S-path-fail
mark :2
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit setup
COMMIT
M 100644 :1 hello.c
commit refs/heads/S-path-fail
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit with bad path
COMMIT
from :2
$prefix$path$suffix
EOF
test_grep "$err_grep" err
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'Invalid dest' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xInvalid dest'
++ test 'x!' = 'xInvalid dest'
++ grep 'Invalid dest' err
fatal: Invalid dest: C hello.c "hello.c
++ return 0
ok 206 - S: filecopy with unclosed " in dest must fail
expecting success of 9300.207 'S: filecopy with invalid escape in quoted dest must fail':
test_must_fail git fast-import <<-EOF 2>err &&
blob
mark :1
data <<BLOB
hello world
BLOB
commit refs/heads/S-path-fail
mark :2
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit setup
COMMIT
M 100644 :1 hello.c
commit refs/heads/S-path-fail
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit with bad path
COMMIT
from :2
$prefix$path$suffix
EOF
test_grep "$err_grep" err
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'Invalid dest' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xInvalid dest'
++ test 'x!' = 'xInvalid dest'
++ grep 'Invalid dest' err
fatal: Invalid dest: C hello.c "hello\xff"
++ return 0
ok 207 - S: filecopy with invalid escape in quoted dest must fail
expecting success of 9300.208 'S: filecopy with escaped NUL in quoted dest must fail':
test_must_fail git fast-import <<-EOF 2>err &&
blob
mark :1
data <<BLOB
hello world
BLOB
commit refs/heads/S-path-fail
mark :2
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit setup
COMMIT
M 100644 :1 hello.c
commit refs/heads/S-path-fail
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit with bad path
COMMIT
from :2
$prefix$path$suffix
EOF
test_grep "$err_grep" err
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'NUL in dest' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xNUL in dest'
++ test 'x!' = 'xNUL in dest'
++ grep 'NUL in dest' err
fatal: NUL in dest: C hello.c "hello\000"
++ return 0
ok 208 - S: filecopy with escaped NUL in quoted dest must fail
expecting success of 9300.209 'S: filecopy with garbage after quoted dest must fail':
test_must_fail git fast-import <<-EOF 2>err &&
blob
mark :1
data <<BLOB
hello world
BLOB
commit refs/heads/S-path-fail
mark :2
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit setup
COMMIT
M 100644 :1 hello.c
commit refs/heads/S-path-fail
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit with bad path
COMMIT
from :2
$prefix$path$suffix
EOF
test_grep "$err_grep" err
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'Garbage after dest' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xGarbage after dest'
++ test 'x!' = 'xGarbage after dest'
++ grep 'Garbage after dest' err
fatal: Garbage after dest: C hello.c "hello.c"x
++ return 0
ok 209 - S: filecopy with garbage after quoted dest must fail
expecting success of 9300.210 'S: filecopy with space after quoted dest must fail':
test_must_fail git fast-import <<-EOF 2>err &&
blob
mark :1
data <<BLOB
hello world
BLOB
commit refs/heads/S-path-fail
mark :2
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit setup
COMMIT
M 100644 :1 hello.c
commit refs/heads/S-path-fail
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit with bad path
COMMIT
from :2
$prefix$path$suffix
EOF
test_grep "$err_grep" err
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'Garbage after dest' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xGarbage after dest'
++ test 'x!' = 'xGarbage after dest'
++ grep 'Garbage after dest' err
fatal: Garbage after dest: C hello.c "hello.c"
++ return 0
ok 210 - S: filecopy with space after quoted dest must fail
expecting success of 9300.211 'S: filerename with unclosed " in source must fail':
test_must_fail git fast-import <<-EOF 2>err &&
blob
mark :1
data <<BLOB
hello world
BLOB
commit refs/heads/S-path-fail
mark :2
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit setup
COMMIT
M 100644 :1 hello.c
commit refs/heads/S-path-fail
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit with bad path
COMMIT
from :2
$prefix$path$suffix
EOF
test_grep "$err_grep" err
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'Invalid source' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xInvalid source'
++ test 'x!' = 'xInvalid source'
++ grep 'Invalid source' err
fatal: Invalid source: R "hello.c world.c
++ return 0
ok 211 - S: filerename with unclosed " in source must fail
expecting success of 9300.212 'S: filerename with invalid escape in quoted source must fail':
test_must_fail git fast-import <<-EOF 2>err &&
blob
mark :1
data <<BLOB
hello world
BLOB
commit refs/heads/S-path-fail
mark :2
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit setup
COMMIT
M 100644 :1 hello.c
commit refs/heads/S-path-fail
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit with bad path
COMMIT
from :2
$prefix$path$suffix
EOF
test_grep "$err_grep" err
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'Invalid source' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xInvalid source'
++ test 'x!' = 'xInvalid source'
++ grep 'Invalid source' err
fatal: Invalid source: R "hello\xff" world.c
++ return 0
ok 212 - S: filerename with invalid escape in quoted source must fail
expecting success of 9300.213 'S: filerename with escaped NUL in quoted source must fail':
test_must_fail git fast-import <<-EOF 2>err &&
blob
mark :1
data <<BLOB
hello world
BLOB
commit refs/heads/S-path-fail
mark :2
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit setup
COMMIT
M 100644 :1 hello.c
commit refs/heads/S-path-fail
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit with bad path
COMMIT
from :2
$prefix$path$suffix
EOF
test_grep "$err_grep" err
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'NUL in source' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xNUL in source'
++ test 'x!' = 'xNUL in source'
++ grep 'NUL in source' err
fatal: NUL in source: R "hello\000" world.c
++ return 0
ok 213 - S: filerename with escaped NUL in quoted source must fail
expecting success of 9300.214 'S: filerename with missing space after quoted source must fail':
test_must_fail git fast-import <<-EOF 2>err &&
blob
mark :1
data <<BLOB
hello world
BLOB
commit refs/heads/S-path-fail
mark :2
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit setup
COMMIT
M 100644 :1 hello.c
commit refs/heads/S-path-fail
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit with bad path
COMMIT
from :2
$prefix$path$suffix
EOF
test_grep "$err_grep" err
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'Missing space after source' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xMissing space after source'
++ test 'x!' = 'xMissing space after source'
++ grep 'Missing space after source' err
fatal: Missing space after source: R "hello.c"x world.c
++ return 0
ok 214 - S: filerename with missing space after quoted source must fail
expecting success of 9300.215 'S: filerename with missing space after unquoted source must fail':
test_must_fail git fast-import <<-EOF 2>err &&
blob
mark :1
data <<BLOB
hello world
BLOB
commit refs/heads/S-path-fail
mark :2
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit setup
COMMIT
M 100644 :1 hello.c
commit refs/heads/S-path-fail
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit with bad path
COMMIT
from :2
$prefix$path$suffix
EOF
test_grep "$err_grep" err
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'Missing space after source' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xMissing space after source'
++ test 'x!' = 'xMissing space after source'
++ grep 'Missing space after source' err
fatal: Missing space after source: R hello.c
++ return 0
ok 215 - S: filerename with missing space after unquoted source must fail
expecting success of 9300.216 'S: filerename with unclosed " in dest must fail':
test_must_fail git fast-import <<-EOF 2>err &&
blob
mark :1
data <<BLOB
hello world
BLOB
commit refs/heads/S-path-fail
mark :2
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit setup
COMMIT
M 100644 :1 hello.c
commit refs/heads/S-path-fail
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit with bad path
COMMIT
from :2
$prefix$path$suffix
EOF
test_grep "$err_grep" err
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'Invalid dest' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xInvalid dest'
++ test 'x!' = 'xInvalid dest'
++ grep 'Invalid dest' err
fatal: Invalid dest: R hello.c "hello.c
++ return 0
ok 216 - S: filerename with unclosed " in dest must fail
expecting success of 9300.217 'S: filerename with invalid escape in quoted dest must fail':
test_must_fail git fast-import <<-EOF 2>err &&
blob
mark :1
data <<BLOB
hello world
BLOB
commit refs/heads/S-path-fail
mark :2
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit setup
COMMIT
M 100644 :1 hello.c
commit refs/heads/S-path-fail
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit with bad path
COMMIT
from :2
$prefix$path$suffix
EOF
test_grep "$err_grep" err
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'Invalid dest' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xInvalid dest'
++ test 'x!' = 'xInvalid dest'
++ grep 'Invalid dest' err
fatal: Invalid dest: R hello.c "hello\xff"
++ return 0
ok 217 - S: filerename with invalid escape in quoted dest must fail
expecting success of 9300.218 'S: filerename with escaped NUL in quoted dest must fail':
test_must_fail git fast-import <<-EOF 2>err &&
blob
mark :1
data <<BLOB
hello world
BLOB
commit refs/heads/S-path-fail
mark :2
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit setup
COMMIT
M 100644 :1 hello.c
commit refs/heads/S-path-fail
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit with bad path
COMMIT
from :2
$prefix$path$suffix
EOF
test_grep "$err_grep" err
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'NUL in dest' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xNUL in dest'
++ test 'x!' = 'xNUL in dest'
++ grep 'NUL in dest' err
fatal: NUL in dest: R hello.c "hello\000"
++ return 0
ok 218 - S: filerename with escaped NUL in quoted dest must fail
expecting success of 9300.219 'S: filerename with garbage after quoted dest must fail':
test_must_fail git fast-import <<-EOF 2>err &&
blob
mark :1
data <<BLOB
hello world
BLOB
commit refs/heads/S-path-fail
mark :2
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit setup
COMMIT
M 100644 :1 hello.c
commit refs/heads/S-path-fail
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit with bad path
COMMIT
from :2
$prefix$path$suffix
EOF
test_grep "$err_grep" err
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'Garbage after dest' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xGarbage after dest'
++ test 'x!' = 'xGarbage after dest'
++ grep 'Garbage after dest' err
fatal: Garbage after dest: R hello.c "hello.c"x
++ return 0
ok 219 - S: filerename with garbage after quoted dest must fail
expecting success of 9300.220 'S: filerename with space after quoted dest must fail':
test_must_fail git fast-import <<-EOF 2>err &&
blob
mark :1
data <<BLOB
hello world
BLOB
commit refs/heads/S-path-fail
mark :2
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit setup
COMMIT
M 100644 :1 hello.c
commit refs/heads/S-path-fail
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit with bad path
COMMIT
from :2
$prefix$path$suffix
EOF
test_grep "$err_grep" err
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'Garbage after dest' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xGarbage after dest'
++ test 'x!' = 'xGarbage after dest'
++ grep 'Garbage after dest' err
fatal: Garbage after dest: R hello.c "hello.c"
++ return 0
ok 220 - S: filerename with space after quoted dest must fail
expecting success of 9300.221 'S: ls (in commit) with unclosed " in path must fail':
test_must_fail git fast-import <<-EOF 2>err &&
blob
mark :1
data <<BLOB
hello world
BLOB
commit refs/heads/S-path-fail
mark :2
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit setup
COMMIT
M 100644 :1 hello.c
commit refs/heads/S-path-fail
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit with bad path
COMMIT
from :2
$prefix$path$suffix
EOF
test_grep "$err_grep" err
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'Invalid path' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xInvalid path'
++ test 'x!' = 'xInvalid path'
++ grep 'Invalid path' err
fatal: Invalid path: ls :2 "hello.c
++ return 0
ok 221 - S: ls (in commit) with unclosed " in path must fail
expecting success of 9300.222 'S: ls (in commit) with invalid escape in quoted path must fail':
test_must_fail git fast-import <<-EOF 2>err &&
blob
mark :1
data <<BLOB
hello world
BLOB
commit refs/heads/S-path-fail
mark :2
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit setup
COMMIT
M 100644 :1 hello.c
commit refs/heads/S-path-fail
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit with bad path
COMMIT
from :2
$prefix$path$suffix
EOF
test_grep "$err_grep" err
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'Invalid path' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xInvalid path'
++ test 'x!' = 'xInvalid path'
++ grep 'Invalid path' err
fatal: Invalid path: ls :2 "hello\xff"
++ return 0
ok 222 - S: ls (in commit) with invalid escape in quoted path must fail
expecting success of 9300.223 'S: ls (in commit) with escaped NUL in quoted path must fail':
test_must_fail git fast-import <<-EOF 2>err &&
blob
mark :1
data <<BLOB
hello world
BLOB
commit refs/heads/S-path-fail
mark :2
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit setup
COMMIT
M 100644 :1 hello.c
commit refs/heads/S-path-fail
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit with bad path
COMMIT
from :2
$prefix$path$suffix
EOF
test_grep "$err_grep" err
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'NUL in path' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xNUL in path'
++ test 'x!' = 'xNUL in path'
++ grep 'NUL in path' err
fatal: NUL in path: ls :2 "hello\000"
++ return 0
ok 223 - S: ls (in commit) with escaped NUL in quoted path must fail
expecting success of 9300.224 'S: ls (in commit) with garbage after quoted path must fail':
test_must_fail git fast-import <<-EOF 2>err &&
blob
mark :1
data <<BLOB
hello world
BLOB
commit refs/heads/S-path-fail
mark :2
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit setup
COMMIT
M 100644 :1 hello.c
commit refs/heads/S-path-fail
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit with bad path
COMMIT
from :2
$prefix$path$suffix
EOF
test_grep "$err_grep" err
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'Garbage after path' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xGarbage after path'
++ test 'x!' = 'xGarbage after path'
++ grep 'Garbage after path' err
fatal: Garbage after path: ls :2 "hello.c"x
++ return 0
ok 224 - S: ls (in commit) with garbage after quoted path must fail
expecting success of 9300.225 'S: ls (in commit) with space after quoted path must fail':
test_must_fail git fast-import <<-EOF 2>err &&
blob
mark :1
data <<BLOB
hello world
BLOB
commit refs/heads/S-path-fail
mark :2
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit setup
COMMIT
M 100644 :1 hello.c
commit refs/heads/S-path-fail
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit with bad path
COMMIT
from :2
$prefix$path$suffix
EOF
test_grep "$err_grep" err
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'Garbage after path' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xGarbage after path'
++ test 'x!' = 'xGarbage after path'
++ grep 'Garbage after path' err
fatal: Garbage after path: ls :2 "hello.c"
++ return 0
ok 225 - S: ls (in commit) with space after quoted path must fail
expecting success of 9300.226 'S: ls (without dataref in commit) with unclosed " in path must fail':
test_must_fail git fast-import <<-EOF 2>err &&
blob
mark :1
data <<BLOB
hello world
BLOB
commit refs/heads/S-path-fail
mark :2
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit setup
COMMIT
M 100644 :1 hello.c
commit refs/heads/S-path-fail
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit with bad path
COMMIT
from :2
$prefix$path$suffix
EOF
test_grep "$err_grep" err
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'Invalid path' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xInvalid path'
++ test 'x!' = 'xInvalid path'
++ grep 'Invalid path' err
fatal: Invalid path: ls "hello.c
++ return 0
ok 226 - S: ls (without dataref in commit) with unclosed " in path must fail
expecting success of 9300.227 'S: ls (without dataref in commit) with invalid escape in quoted path must fail':
test_must_fail git fast-import <<-EOF 2>err &&
blob
mark :1
data <<BLOB
hello world
BLOB
commit refs/heads/S-path-fail
mark :2
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit setup
COMMIT
M 100644 :1 hello.c
commit refs/heads/S-path-fail
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit with bad path
COMMIT
from :2
$prefix$path$suffix
EOF
test_grep "$err_grep" err
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'Invalid path' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xInvalid path'
++ test 'x!' = 'xInvalid path'
++ grep 'Invalid path' err
fatal: Invalid path: ls "hello\xff"
++ return 0
ok 227 - S: ls (without dataref in commit) with invalid escape in quoted path must fail
expecting success of 9300.228 'S: ls (without dataref in commit) with escaped NUL in quoted path must fail':
test_must_fail git fast-import <<-EOF 2>err &&
blob
mark :1
data <<BLOB
hello world
BLOB
commit refs/heads/S-path-fail
mark :2
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit setup
COMMIT
M 100644 :1 hello.c
commit refs/heads/S-path-fail
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit with bad path
COMMIT
from :2
$prefix$path$suffix
EOF
test_grep "$err_grep" err
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'NUL in path' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xNUL in path'
++ test 'x!' = 'xNUL in path'
++ grep 'NUL in path' err
fatal: NUL in path: ls "hello\000"
++ return 0
ok 228 - S: ls (without dataref in commit) with escaped NUL in quoted path must fail
expecting success of 9300.229 'S: ls (without dataref in commit) with garbage after quoted path must fail':
test_must_fail git fast-import <<-EOF 2>err &&
blob
mark :1
data <<BLOB
hello world
BLOB
commit refs/heads/S-path-fail
mark :2
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit setup
COMMIT
M 100644 :1 hello.c
commit refs/heads/S-path-fail
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit with bad path
COMMIT
from :2
$prefix$path$suffix
EOF
test_grep "$err_grep" err
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'Garbage after path' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xGarbage after path'
++ test 'x!' = 'xGarbage after path'
++ grep 'Garbage after path' err
fatal: Garbage after path: ls "hello.c"x
++ return 0
ok 229 - S: ls (without dataref in commit) with garbage after quoted path must fail
expecting success of 9300.230 'S: ls (without dataref in commit) with space after quoted path must fail':
test_must_fail git fast-import <<-EOF 2>err &&
blob
mark :1
data <<BLOB
hello world
BLOB
commit refs/heads/S-path-fail
mark :2
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit setup
COMMIT
M 100644 :1 hello.c
commit refs/heads/S-path-fail
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
commit with bad path
COMMIT
from :2
$prefix$path$suffix
EOF
test_grep "$err_grep" err
++ test_must_fail git fast-import
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
++ test_grep 'Garbage after path' err
++ eval 'last_arg=${2}'
+++ last_arg=err
++ test -f err
++ test 2 -lt 2
++ test 'x!' = 'xGarbage after path'
++ test 'x!' = 'xGarbage after path'
++ grep 'Garbage after path' err
fatal: Garbage after path: ls "hello.c"
++ return 0
ok 230 - S: ls (without dataref in commit) with space after quoted path must fail
expecting success of 9300.231 'T: ls root ("") tree':
sed -e "s/Z\$//" >expect <<-EOF &&
040000 tree $(git rev-parse S^{tree}) Z
EOF
sha1=$(git rev-parse --verify S) &&
git fast-import --import-marks=marks <<-EOF >actual &&
ls $sha1 $root
EOF
test_cmp expect actual
++ sed -e 's/Z$//'
+++ git rev-parse 'S^{tree}'
+++ git rev-parse --verify S
++ sha1=09b8212d623219bb80c949d5065e559b231d90ad
++ git fast-import --import-marks=marks
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 0 ( 0 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 0 ( 0 duplicates 0 deltas of 0 attempts)
commits: 0 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 0 ( 0 loads )
marks: 1024 ( 5 unique )
atoms: 1
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 8
pack_report: pack_mmap_calls = 2
pack_report: pack_open_windows = 2 / 2
pack_report: pack_mapped = 680 / 680
---------------------------------------------------------------------
++ test_cmp expect actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual
ok 231 - T: ls root ("") tree
expecting success of 9300.232 'T: ls root () tree':
sed -e "s/Z\$//" >expect <<-EOF &&
040000 tree $(git rev-parse S^{tree}) Z
EOF
sha1=$(git rev-parse --verify S) &&
git fast-import --import-marks=marks <<-EOF >actual &&
ls $sha1 $root
EOF
test_cmp expect actual
++ sed -e 's/Z$//'
+++ git rev-parse 'S^{tree}'
+++ git rev-parse --verify S
++ sha1=09b8212d623219bb80c949d5065e559b231d90ad
++ git fast-import --import-marks=marks
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 0 ( 0 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 0 ( 0 duplicates 0 deltas of 0 attempts)
commits: 0 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 0 ( 0 loads )
marks: 1024 ( 5 unique )
atoms: 1
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 8
pack_report: pack_mmap_calls = 2
pack_report: pack_open_windows = 2 / 2
pack_report: pack_mapped = 680 / 680
---------------------------------------------------------------------
++ test_cmp expect actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u expect actual
ok 232 - T: ls root () tree
expecting success of 9300.233 'T: delete branch':
git branch to-delete &&
git fast-import <<-EOF &&
reset refs/heads/to-delete
from $ZERO_OID
EOF
test_must_fail git rev-parse --verify refs/heads/to-delete
++ git branch to-delete
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 0 ( 0 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 0 ( 0 duplicates 0 deltas of 0 attempts)
commits: 0 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 0 loads )
marks: 1024 ( 0 unique )
atoms: 0
Memory total: 2399 KiB
pools: 2048 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 0
pack_report: pack_mmap_calls = 0
pack_report: pack_open_windows = 0 / 0
pack_report: pack_mapped = 0 / 0
---------------------------------------------------------------------
++ test_must_fail git rev-parse --verify refs/heads/to-delete
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git rev-parse --verify refs/heads/to-delete
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git rev-parse --verify refs/heads/to-delete
fatal: Needed a single revision
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
ok 233 - T: delete branch
expecting success of 9300.234 'T: empty reset doesnt delete branch':
git branch not-to-delete &&
git fast-import <<-EOF &&
reset refs/heads/not-to-delete
EOF
git show-ref &&
git rev-parse --verify refs/heads/not-to-delete
++ git branch not-to-delete
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 0 ( 0 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 0 ( 0 duplicates 0 deltas of 0 attempts)
commits: 0 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 0 loads )
marks: 1024 ( 0 unique )
atoms: 0
Memory total: 2399 KiB
pools: 2048 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 0
pack_report: core.packedGitLimit = 0
pack_report: pack_used_ctr = 0
pack_report: pack_mmap_calls = 0
pack_report: pack_open_windows = 0 / 0
pack_report: pack_mapped = 0 / 0
---------------------------------------------------------------------
++ git show-ref
8c1bf1b9f891df8805c27a54986e5043829939ad refs/heads/H
45b12606bd487d1bc687864db7641b9bfd4ddcd0 refs/heads/J
c85b9f480bbc2f7616de78fc96c08204e0f5b70e refs/heads/K
8cecdab6b3e4062de5b06ad3accf5bff1449e99b refs/heads/L
7144e0bde79efa21349b6a09f1b68b74e59da773 refs/heads/M1
0641406b2b83a2c327e6950aa51f13010fe647b1 refs/heads/M2
b258d10cb71ac72904c40ef2d07b67e3f444ce19 refs/heads/M3
afc4da065d1be07543ab49500b355f7342f5a0bf refs/heads/M4
d80c4052a8e9a163f90de3fa74ec993595d7f0b3 refs/heads/N-copy-root-path
d3d6f982387839292885129c8f925f0437fe8f8f refs/heads/N-delete
3a992f7db92c8513f272cb38ecd20b1891ea3618 refs/heads/N1
c5e590066ca8fc360460c8c12cb33cb852fe8d0e refs/heads/N10
0d366d7b90432787294f20469f92247cd2951e56 refs/heads/N11
feb51e70222384549d211ed8556032a4d8de86d5 refs/heads/N2
c9fa8f49cd89b0c79e2653acbf382fc67897cacc refs/heads/N3
9d4aea7a2664059c10686d61ddd966f87bb2e5e1 refs/heads/N4
72ab72aa5baed6139c0e3d8e970743a3b95c04ff refs/heads/N5
0cc1189ab86929904ba103aecb7d99a9f4ceefb0 refs/heads/N6
94c8d03670e041ed0d66ff5434e05078c76fe308 refs/heads/N7
6377394cead24e0a81b85518dd6aae87af60b2d5 refs/heads/N8
50a2b9031b6d523dbb219a9618b84e771592ce06 refs/heads/N9
c9fa8f49cd89b0c79e2653acbf382fc67897cacc refs/heads/O1
c9fa8f49cd89b0c79e2653acbf382fc67897cacc refs/heads/O2
5fda0e679bf57704417152105e584e0a694c013c refs/heads/O3
5fda0e679bf57704417152105e584e0a694c013c refs/heads/O4
09b8212d623219bb80c949d5065e559b231d90ad refs/heads/S
08ce2f4d8b480172783d3891735f90a7d7e00607 refs/heads/S2
f9eb178a57581c4b6ee59a2a22ee91689c065e26 refs/heads/branch
e539ffaa4ddf139e244fadc551da26e24df78619 refs/heads/copied
c04abfe6415075f472cd37c5c8655c105f9934e6 refs/heads/done-ends
d892dc32fa7a52ea3a397cfc4449e9df8a39becf refs/heads/export-boundary
5ba2d0485e3e071f4ccbfdb22c474b305ebd159c refs/heads/main
994b824fbe51b899f546383c3ba14a28a07c1022 refs/heads/new_blob
c281a9691c7fe3cad66d25a374a13f3b1ad983e7 refs/heads/not-to-delete
7aa420e73b93d5b69059a2ff8e850a2ed9411187 refs/heads/notes-test
fb7baf16109664b6b1d3b3c98d6c252fa7051ae5 refs/heads/other
e908a53cdb6af68565f1b355f92ce0fc768a58b1 refs/heads/read-empty
c281a9691c7fe3cad66d25a374a13f3b1ad983e7 refs/heads/subuse1
c281a9691c7fe3cad66d25a374a13f3b1ad983e7 refs/heads/subuse2
65eaf13fb93713eb9d3f5e4e899ade4effc77e3e refs/heads/temporary
6b33e55cd592e91710d6c0afef1b0e6e3406a2a7 refs/heads/verify--dump-marks
ac2b62088fe0283163c00fa7856bcd0489cf30de refs/heads/verify--import-marks
65eaf13fb93713eb9d3f5e4e899ade4effc77e3e refs/heads/within
b8613b3cac8d5f3f8aecc431636e4c27c64699dc refs/notes/foobar
e684625a6e98f3faaa87d19d490e005e375de0e3 refs/notes/foobar2
c713cf4a9446ade70da02a4734370997de4d36e6 refs/tags/O3-2nd
c713cf4a9446ade70da02a4734370997de4d36e6 refs/tags/O3-3rd
0e22025f0f5cea5d83b68c3dc9fc334571f7196c refs/tags/nested
103553a16e02d76e288cec0f76240f1ad97caeb9 refs/tags/series-A
42d861d649a1b87eb8083ad1d94d9220ecf2c35f refs/tags/series-A-blob
3750af27267cae07dd3f8b7a9aac2291e374a66a refs/tags/series-A-blob-2
56c14ce987117cf2e391ebef3dbab65e4c1ed202 refs/tags/series-A-blob-3
++ git rev-parse --verify refs/heads/not-to-delete
c281a9691c7fe3cad66d25a374a13f3b1ad983e7
ok 234 - T: empty reset doesnt delete branch
expecting success of 9300.235 'U: initialize for U tests':
cat >input <<-INPUT_END &&
commit refs/heads/U
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
test setup
COMMIT
M 100644 inline hello.c
data <<BLOB
blob 1
BLOB
M 100644 inline good/night.txt
data <<BLOB
sleep well
BLOB
M 100644 inline good/bye.txt
data <<BLOB
au revoir
BLOB
INPUT_END
f7id=$(echo "blob 1" | git hash-object --stdin) &&
f8id=$(echo "sleep well" | git hash-object --stdin) &&
f9id=$(echo "au revoir" | git hash-object --stdin) &&
git fast-import <input
++ cat
+++ echo 'blob 1'
+++ git hash-object --stdin
++ f7id=c18147dc648481eeb65dc5e66628429a64843327
+++ echo 'sleep well'
+++ git hash-object --stdin
++ f8id=2907ebb4bf85d91bf0716bb3bd8a68ef48d6da76
+++ echo 'au revoir'
+++ git hash-object --stdin
++ f9id=69cb75792f55123d8389c156b0b41c2ff00ed507
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 5 ( 1 duplicates )
blobs : 2 ( 1 duplicates 0 deltas of 0 attempts)
trees : 2 ( 0 duplicates 0 deltas of 0 attempts)
commits: 1 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 4
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 2
pack_report: pack_mmap_calls = 1
pack_report: pack_open_windows = 1 / 1
pack_report: pack_mapped = 349 / 349
---------------------------------------------------------------------
ok 235 - U: initialize for U tests
expecting success of 9300.236 'U: filedelete file succeeds':
cat >input <<-INPUT_END &&
commit refs/heads/U
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
delete good/night.txt
COMMIT
from refs/heads/U^0
D good/night.txt
INPUT_END
git fast-import <input
++ cat
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 3 ( 0 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 2 ( 0 duplicates 0 deltas of 0 attempts)
commits: 1 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 4
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 7
pack_report: pack_mmap_calls = 2
pack_report: pack_open_windows = 2 / 2
pack_report: pack_mapped = 666 / 666
---------------------------------------------------------------------
ok 236 - U: filedelete file succeeds
expecting success of 9300.237 'U: validate file delete result':
cat >expect <<-EOF &&
:100644 000000 $f8id $ZERO_OID D good/night.txt
EOF
git diff-tree -M -r U^1 U >actual &&
compare_diff_raw expect actual
++ cat
++ git diff-tree -M -r 'U^1' U
++ compare_diff_raw expect actual
++ sed -e '/^:/s/ \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([A-Z]\)[0-9]* / \1 \2 \3# /'
++ sed -e '/^:/s/ \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([A-Z]\)[0-9]* / \1 \2 \3# /'
++ test_cmp .tmp-1 .tmp-2
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u .tmp-1 .tmp-2
++ rm -f .tmp-1 .tmp-2
ok 237 - U: validate file delete result
expecting success of 9300.238 'U: filedelete directory succeeds':
cat >input <<-INPUT_END &&
commit refs/heads/U
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
delete good dir
COMMIT
from refs/heads/U^0
D good
INPUT_END
git fast-import <input
++ cat
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 1 ( 1 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 0 ( 1 duplicates 0 deltas of 0 attempts)
commits: 1 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 2
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 6
pack_report: pack_mmap_calls = 2
pack_report: pack_open_windows = 2 / 2
pack_report: pack_mapped = 503 / 503
---------------------------------------------------------------------
ok 238 - U: filedelete directory succeeds
expecting success of 9300.239 'U: validate directory delete result':
cat >expect <<-EOF &&
:100644 000000 $f9id $ZERO_OID D good/bye.txt
EOF
git diff-tree -M -r U^1 U >actual &&
compare_diff_raw expect actual
++ cat
++ git diff-tree -M -r 'U^1' U
++ compare_diff_raw expect actual
++ sed -e '/^:/s/ \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([A-Z]\)[0-9]* / \1 \2 \3# /'
++ sed -e '/^:/s/ \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([A-Z]\)[0-9]* / \1 \2 \3# /'
++ test_cmp .tmp-1 .tmp-2
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u .tmp-1 .tmp-2
++ rm -f .tmp-1 .tmp-2
ok 239 - U: validate directory delete result
expecting success of 9300.240 'U: filedelete root ("") succeeds':
cat >input <<-INPUT_END &&
commit refs/heads/U-delete-root
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
must succeed
COMMIT
from refs/heads/U^0
D $root
INPUT_END
git fast-import <input
++ cat
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 1 ( 1 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 0 ( 1 duplicates 0 deltas of 0 attempts)
commits: 1 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 1
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 6
pack_report: pack_mmap_calls = 3
pack_report: pack_open_windows = 3 / 3
pack_report: pack_mapped = 827 / 827
---------------------------------------------------------------------
ok 240 - U: filedelete root ("") succeeds
expecting success of 9300.241 'U: validate root ("") delete result':
cat >expect <<-EOF &&
:100644 000000 $f7id $ZERO_OID D hello.c
EOF
git diff-tree -M -r U U-delete-root >actual &&
compare_diff_raw expect actual
++ cat
++ git diff-tree -M -r U U-delete-root
++ compare_diff_raw expect actual
++ sed -e '/^:/s/ \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([A-Z]\)[0-9]* / \1 \2 \3# /'
++ sed -e '/^:/s/ \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([A-Z]\)[0-9]* / \1 \2 \3# /'
++ test_cmp .tmp-1 .tmp-2
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u .tmp-1 .tmp-2
++ rm -f .tmp-1 .tmp-2
ok 241 - U: validate root ("") delete result
expecting success of 9300.242 'U: filedelete root () succeeds':
cat >input <<-INPUT_END &&
commit refs/heads/U-delete-root
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data <<COMMIT
must succeed
COMMIT
from refs/heads/U^0
D $root
INPUT_END
git fast-import <input
++ cat
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 0 ( 2 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 0 ( 1 duplicates 0 deltas of 0 attempts)
commits: 0 ( 1 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 1
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 6
pack_report: pack_mmap_calls = 3
pack_report: pack_open_windows = 3 / 3
pack_report: pack_mapped = 827 / 827
---------------------------------------------------------------------
ok 242 - U: filedelete root () succeeds
expecting success of 9300.243 'U: validate root () delete result':
cat >expect <<-EOF &&
:100644 000000 $f7id $ZERO_OID D hello.c
EOF
git diff-tree -M -r U U-delete-root >actual &&
compare_diff_raw expect actual
++ cat
++ git diff-tree -M -r U U-delete-root
++ compare_diff_raw expect actual
++ sed -e '/^:/s/ \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([A-Z]\)[0-9]* / \1 \2 \3# /'
++ sed -e '/^:/s/ \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f][0-9a-f]\) \([A-Z]\)[0-9]* / \1 \2 \3# /'
++ test_cmp .tmp-1 .tmp-2
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u .tmp-1 .tmp-2
++ rm -f .tmp-1 .tmp-2
ok 243 - U: validate root () delete result
expecting success of 9300.244 'V: checkpoint helper does not get stuck with extra output':
cat >input <<-INPUT_END &&
progress foo
progress bar
INPUT_END
background_import_then_checkpoint "" input &&
background_import_still_running
++ cat
++ background_import_then_checkpoint '' input
++ options=
++ input_file=input
++ mkfifo V.input
++ exec
++ rm V.input
++ mkfifo V.output
++ exec
++ rm V.output
++ sh_pid=1944732
++ read fi_pid
++ echo 1944733
++ git fast-import
++ wait 1944733
++ test_when_finished '
exec 8>&-; exec 9>&-;
kill 1944732 && wait 1944732
kill 1944733 && wait 1944733
true'
++ test 0 = 0
++ test_cleanup='{
exec 8>&-; exec 9>&-;
kill 1944732 && wait 1944732
kill 1944733 && wait 1944733
true
} && (exit "$eval_ret"); eval_ret=$?; :'
++ error=1
++ cat input
++ read output
cat: standard output: No such file or directory
++ echo checkpoint
++ echo 'progress checkpoint'
++ test 'progress checkpoint' = 'progress checkpoint'
++ error=0
++ break
++ test 0 -eq 1
++ background_import_still_running
++ kill -0 1944733
++ exec
++ exec
++ kill 1944732
++ wait 1944732
++ kill 1944733
++ wait 1944733
./test-lib.sh: line 1003: wait: pid 1944733 is not a child of this shell
++ true
++ exit 0
++ eval_ret=0
++ :
ok 244 - V: checkpoint helper does not get stuck with extra output
expecting success of 9300.245 'V: checkpoint updates refs after reset':
cat >input <<-\INPUT_END &&
reset refs/heads/V
from refs/heads/U
INPUT_END
background_import_then_checkpoint "" input &&
test "$(git rev-parse --verify V)" = "$(git rev-parse --verify U)" &&
background_import_still_running
++ cat
++ background_import_then_checkpoint '' input
++ options=
++ input_file=input
++ mkfifo V.input
++ exec
++ rm V.input
++ mkfifo V.output
++ exec
++ rm V.output
++ sh_pid=1944743
++ read fi_pid
++ echo 1944744
++ git fast-import
++ wait 1944744
++ test_when_finished '
exec 8>&-; exec 9>&-;
kill 1944743 && wait 1944743
kill 1944744 && wait 1944744
true'
++ test 0 = 0
++ test_cleanup='{
exec 8>&-; exec 9>&-;
kill 1944743 && wait 1944743
kill 1944744 && wait 1944744
true
} && (exit "$eval_ret"); eval_ret=$?; :'
++ error=1
++ read output
++ cat input
cat: standard output: No such file or directory
++ echo checkpoint
++ echo 'progress checkpoint'
++ test 'progress checkpoint' = 'progress checkpoint'
++ error=0
++ break
++ test 0 -eq 1
+++ git rev-parse --verify V
fatal: Needed a single revision
+++ git rev-parse --verify U
++ test '' = fba70919bc168b7dd19cd67023869be620d1a2f8
error: last command exited with $?=1
++ exec
++ exec
++ kill 1944743
++ wait 1944743
++ kill 1944744
++ wait 1944744
./test-lib.sh: line 1003: wait: pid 1944744 is not a child of this shell
++ true
++ exit 1
++ eval_ret=1
++ :
not ok 245 - V: checkpoint updates refs after reset
#
# cat >input <<-\INPUT_END &&
# reset refs/heads/V
# from refs/heads/U
#
# INPUT_END
#
# background_import_then_checkpoint "" input &&
# test "$(git rev-parse --verify V)" = "$(git rev-parse --verify U)" &&
# background_import_still_running
#
expecting success of 9300.246 'V: checkpoint updates refs and marks after commit':
cat >input <<-INPUT_END &&
commit refs/heads/V
mark :1
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data 0
from refs/heads/U
INPUT_END
background_import_then_checkpoint "--export-marks=marks.actual" input &&
echo ":1 $(git rev-parse --verify V)" >marks.expected &&
test "$(git rev-parse --verify V^)" = "$(git rev-parse --verify U)" &&
test_cmp marks.expected marks.actual &&
background_import_still_running
++ cat
++ background_import_then_checkpoint --export-marks=marks.actual input
++ options=--export-marks=marks.actual
++ input_file=input
++ mkfifo V.input
++ exec
++ rm V.input
++ mkfifo V.output
++ exec
++ rm V.output
++ sh_pid=1944758
++ read fi_pid
++ echo 1944759
++ git fast-import --export-marks=marks.actual
++ wait 1944759
++ test_when_finished '
exec 8>&-; exec 9>&-;
kill 1944758 && wait 1944758
kill 1944759 && wait 1944759
true'
++ test 0 = 0
++ test_cleanup='{
exec 8>&-; exec 9>&-;
kill 1944758 && wait 1944758
kill 1944759 && wait 1944759
true
} && (exit "$eval_ret"); eval_ret=$?; :'
++ error=1
++ read output
++ cat input
cat: standard output: No such file or directory
++ echo checkpoint
++ echo 'progress checkpoint'
++ test 'progress checkpoint' = 'progress checkpoint'
++ error=0
++ break
++ test 0 -eq 1
+++ git rev-parse --verify V
fatal: Needed a single revision
++ echo ':1 '
+++ git rev-parse --verify 'V^'
fatal: Needed a single revision
+++ git rev-parse --verify U
++ test '' = fba70919bc168b7dd19cd67023869be620d1a2f8
error: last command exited with $?=1
++ exec
++ exec
++ kill 1944758
++ wait 1944758
++ kill 1944759
++ wait 1944759
./test-lib.sh: line 1003: wait: pid 1944759 is not a child of this shell
++ true
++ exit 1
++ eval_ret=1
++ :
not ok 246 - V: checkpoint updates refs and marks after commit
#
# cat >input <<-INPUT_END &&
# commit refs/heads/V
# mark :1
# committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
# data 0
# from refs/heads/U
#
# INPUT_END
#
# background_import_then_checkpoint "--export-marks=marks.actual" input &&
#
# echo ":1 $(git rev-parse --verify V)" >marks.expected &&
#
# test "$(git rev-parse --verify V^)" = "$(git rev-parse --verify U)" &&
# test_cmp marks.expected marks.actual &&
# background_import_still_running
#
expecting success of 9300.247 'V: checkpoint updates refs and marks after commit (no new objects)':
cat >input <<-INPUT_END &&
commit refs/heads/V2
mark :2
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data 0
from refs/heads/U
INPUT_END
background_import_then_checkpoint "--export-marks=marks.actual" input &&
echo ":2 $(git rev-parse --verify V2)" >marks.expected &&
test "$(git rev-parse --verify V2)" = "$(git rev-parse --verify V)" &&
test_cmp marks.expected marks.actual &&
background_import_still_running
++ cat
++ background_import_then_checkpoint --export-marks=marks.actual input
++ options=--export-marks=marks.actual
++ input_file=input
++ mkfifo V.input
++ exec
++ rm V.input
++ mkfifo V.output
++ exec
++ rm V.output
++ sh_pid=1944774
++ read fi_pid
++ echo 1944775
++ test_when_finished '
exec 8>&-; exec 9>&-;
kill 1944774 && wait 1944774
kill 1944775 && wait 1944775
true'
++ git fast-import --export-marks=marks.actual
++ test 0 = 0
++ test_cleanup='{
exec 8>&-; exec 9>&-;
kill 1944774 && wait 1944774
kill 1944775 && wait 1944775
true
} && (exit "$eval_ret"); eval_ret=$?; :'
++ error=1
++ read output
++ wait 1944775
++ cat input
cat: standard output: No such file or directory
++ echo checkpoint
++ echo 'progress checkpoint'
++ test 'progress checkpoint' = 'progress checkpoint'
++ error=0
++ break
++ test 0 -eq 1
+++ git rev-parse --verify V2
fatal: Needed a single revision
++ echo ':2 '
+++ git rev-parse --verify V2
fatal: Needed a single revision
+++ git rev-parse --verify V
fatal: Needed a single revision
++ test '' = ''
++ test_cmp marks.expected marks.actual
++ test 2 -ne 2
++ eval 'diff -u' '"$@"'
+++ diff -u marks.expected marks.actual
--- marks.expected 2025-06-15 10:55:46.244739385 +0000
+++ marks.actual 2025-06-15 10:55:46.227510953 +0000
@@ -1 +0,0 @@
-:2
error: last command exited with $?=1
++ exec
++ exec
++ kill 1944774
++ wait 1944774
++ kill 1944775
++ wait 1944775
./test-lib.sh: line 1003: wait: pid 1944775 is not a child of this shell
++ true
++ exit 1
++ eval_ret=1
++ :
not ok 247 - V: checkpoint updates refs and marks after commit (no new objects)
#
# cat >input <<-INPUT_END &&
# commit refs/heads/V2
# mark :2
# committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
# data 0
# from refs/heads/U
#
# INPUT_END
#
# background_import_then_checkpoint "--export-marks=marks.actual" input &&
#
# echo ":2 $(git rev-parse --verify V2)" >marks.expected &&
#
# test "$(git rev-parse --verify V2)" = "$(git rev-parse --verify V)" &&
# test_cmp marks.expected marks.actual &&
# background_import_still_running
#
expecting success of 9300.248 'V: checkpoint updates tags after tag':
cat >input <<-INPUT_END &&
tag Vtag
from refs/heads/V
tagger $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
data 0
INPUT_END
background_import_then_checkpoint "" input &&
git show-ref -d Vtag &&
background_import_still_running
++ cat
++ background_import_then_checkpoint '' input
++ options=
++ input_file=input
++ mkfifo V.input
++ exec
++ rm V.input
++ mkfifo V.output
++ exec
++ rm V.output
++ git fast-import
++ sh_pid=1944791
++ read fi_pid
++ echo 1944792
++ test_when_finished '
exec 8>&-; exec 9>&-;
kill 1944791 && wait 1944791
kill 1944792 && wait 1944792
true'
++ test 0 = 0
++ test_cleanup='{
exec 8>&-; exec 9>&-;
kill 1944791 && wait 1944791
kill 1944792 && wait 1944792
true
} && (exit "$eval_ret"); eval_ret=$?; :'
++ error=1
++ read output
++ wait 1944792
++ cat input
cat: standard output: No such file or directory
++ echo checkpoint
++ echo 'progress checkpoint'
++ test 'progress checkpoint' = 'progress checkpoint'
++ error=0
++ break
++ test 0 -eq 1
++ git show-ref -d Vtag
error: last command exited with $?=1
++ exec
++ exec
++ kill 1944791
++ wait 1944791
++ kill 1944792
++ wait 1944792
./test-lib.sh: line 1003: wait: pid 1944792 is not a child of this shell
++ true
++ exit 1
++ eval_ret=1
++ :
not ok 248 - V: checkpoint updates tags after tag
#
# cat >input <<-INPUT_END &&
# tag Vtag
# from refs/heads/V
# tagger $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
# data 0
#
# INPUT_END
#
# background_import_then_checkpoint "" input &&
# git show-ref -d Vtag &&
# background_import_still_running
#
expecting success of 9300.249 'W: get-mark & empty orphan commit with no newlines':
sed -e s/LFs// W-input | tr L "\n" | git fast-import
++ sed -e s/LFs// W-input
++ tr L '\n'
++ git fast-import
b5522bde54855bd5378728a9119bd1941276b996
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 1 ( 1 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 0 ( 1 duplicates 0 deltas of 0 attempts)
commits: 1 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 1 unique )
atoms: 0
Memory total: 2399 KiB
pools: 2048 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 2
pack_report: pack_mmap_calls = 1
pack_report: pack_open_windows = 1 / 1
pack_report: pack_mapped = 161 / 161
---------------------------------------------------------------------
ok 249 - W: get-mark & empty orphan commit with no newlines
expecting success of 9300.250 'W: get-mark & empty orphan commit with one newline':
sed -e s/LFs/L/ W-input | tr L "\n" | git fast-import
++ sed -e s/LFs/L/ W-input
++ tr L '\n'
++ git fast-import
b5522bde54855bd5378728a9119bd1941276b996
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 0 ( 2 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 0 ( 1 duplicates 0 deltas of 0 attempts)
commits: 0 ( 1 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 1 unique )
atoms: 0
Memory total: 2399 KiB
pools: 2048 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 2
pack_report: pack_mmap_calls = 1
pack_report: pack_open_windows = 1 / 1
pack_report: pack_mapped = 161 / 161
---------------------------------------------------------------------
ok 250 - W: get-mark & empty orphan commit with one newline
expecting success of 9300.251 'W: get-mark & empty orphan commit with ugly second newline':
# Technically, this should fail as it has too many linefeeds
# according to the grammar in fast-import.txt. But, for whatever
# reason, it works. Since using the correct number of newlines
# does not work with older (pre-2.22) versions of git, allow apps
# that used this second-newline workaround to keep working by
# checking it with this test...
sed -e s/LFs/LL/ W-input | tr L "\n" | git fast-import
++ sed -e s/LFs/LL/ W-input
++ tr L '\n'
++ git fast-import
b5522bde54855bd5378728a9119bd1941276b996
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 0 ( 2 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 0 ( 1 duplicates 0 deltas of 0 attempts)
commits: 0 ( 1 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 1 unique )
atoms: 0
Memory total: 2399 KiB
pools: 2048 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 2
pack_report: pack_mmap_calls = 1
pack_report: pack_open_windows = 1 / 1
pack_report: pack_mapped = 161 / 161
---------------------------------------------------------------------
ok 251 - W: get-mark & empty orphan commit with ugly second newline
expecting success of 9300.252 'W: get-mark & empty orphan commit with erroneous third newline':
# ...but do NOT allow more empty lines than that (see previous test).
sed -e s/LFs/LLL/ W-input | tr L "\n" | test_must_fail git fast-import
++ tr L '\n'
++ test_must_fail git fast-import
++ sed -e s/LFs/LLL/ W-input
++ case "$1" in
++ _test_ok=
++ test_must_fail_acceptable git fast-import
++ test git = env
++ test git = nongit
++ case "$1" in
++ return 0
++ git fast-import
fatal: Unsupported command:
fast-import: dumping crash report to .git/fast_import_crash_1944816
++ exit_code=128
++ test 128 -eq 0
++ test_match_signal 13 128
++ test 128 = 141
++ test 128 = 269
++ return 1
++ test 128 -gt 129
++ test 128 -eq 127
++ test 128 -eq 126
++ return 0
ok 252 - W: get-mark & empty orphan commit with erroneous third newline
expecting success of 9300.253 'X: handling encoding':
test_tick &&
cat >input <<-INPUT_END &&
commit refs/heads/encoding
committer $GIT_COMMITTER_NAME <$GIT_COMMITTER_EMAIL> $GIT_COMMITTER_DATE
encoding iso-8859-7
data <<COMMIT
INPUT_END
printf "Pi: \360\nCOMMIT\n" >>input &&
git fast-import <input &&
git cat-file -p encoding | grep $(printf "\360") &&
git log -1 --format=%B encoding | grep $(printf "\317\200")
++ test_tick
++ test -z set
++ test_tick=1112912953
++ GIT_COMMITTER_DATE='1112912953 -0700'
++ GIT_AUTHOR_DATE='1112912953 -0700'
++ export GIT_COMMITTER_DATE GIT_AUTHOR_DATE
++ cat
++ printf 'Pi: \360\nCOMMIT\n'
++ git fast-import
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 1 ( 1 duplicates )
blobs : 0 ( 0 duplicates 0 deltas of 0 attempts)
trees : 0 ( 1 duplicates 0 deltas of 0 attempts)
commits: 1 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 0 unique )
atoms: 0
Memory total: 2399 KiB
pools: 2048 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 2
pack_report: pack_mmap_calls = 1
pack_report: pack_open_windows = 1 / 1
pack_report: pack_mapped = 168 / 168
---------------------------------------------------------------------
++ git cat-file -p encoding
+++ printf '\360'
++ grep $'\360'
Pi: �
++ git log -1 --format=%B encoding
+++ printf '\317\200'
++ grep $'\317\200'
Pi: π
ok 253 - X: handling encoding
expecting success of 9300.254 'X: replace ref that becomes useless is removed':
git init -qb main testrepo &&
cd testrepo &&
(
test_commit test &&
test_commit msg somename content &&
git mv somename othername &&
NEW_TREE=$(git write-tree) &&
MSG="$(git log -1 --format=%B HEAD)" &&
NEW_COMMIT=$(git commit-tree -p HEAD^1 -m "$MSG" $NEW_TREE) &&
git replace main $NEW_COMMIT &&
echo more >>othername &&
git add othername &&
git commit -qm more &&
git fast-export --all >tmp &&
sed -e s/othername/somename/ tmp >tmp2 &&
git fast-import --force <tmp2 2>msgs &&
grep "Dropping.*since it would point to itself" msgs &&
git show-ref >refs &&
! grep refs/replace refs
)
++ git init -qb main testrepo
++ cd testrepo
++ test_commit test
++ local notick=
++ local echo=echo
++ local append=
++ local author=
++ local signoff=
++ local indir=
++ local tag=light
++ test 1 '!=' 0
++ case "$1" in
++ break
++ indir=
++ local file=test.t
++ test -n ''
++ echo test
++ git add -- test.t
++ test -z ''
++ test_tick
++ test -z set
++ test_tick=1112913013
++ GIT_COMMITTER_DATE='1112913013 -0700'
++ GIT_AUTHOR_DATE='1112913013 -0700'
++ export GIT_COMMITTER_DATE GIT_AUTHOR_DATE
++ git commit -m test
[main (root-commit) 4e52f3e] test
Author: A U Thor <[email protected]>
1 file changed, 1 insertion(+)
create mode 100644 test.t
++ case "$tag" in
++ git tag test
++ test_commit msg somename content
++ local notick=
++ local echo=echo
++ local append=
++ local author=
++ local signoff=
++ local indir=
++ local tag=light
++ test 3 '!=' 0
++ case "$1" in
++ break
++ indir=
++ local file=somename
++ test -n ''
++ echo content
++ git add -- somename
++ test -z ''
++ test_tick
++ test -z set
++ test_tick=1112913073
++ GIT_COMMITTER_DATE='1112913073 -0700'
++ GIT_AUTHOR_DATE='1112913073 -0700'
++ export GIT_COMMITTER_DATE GIT_AUTHOR_DATE
++ git commit -m msg
[main fcc7def] msg
Author: A U Thor <[email protected]>
1 file changed, 1 insertion(+)
create mode 100644 somename
++ case "$tag" in
++ git tag msg
++ git mv somename othername
+++ git write-tree
++ NEW_TREE=73b0c846b66cbe166b4014eb7b5f3fa735bdede8
+++ git log -1 --format=%B HEAD
++ MSG=msg
+++ git commit-tree -p 'HEAD^1' -m msg 73b0c846b66cbe166b4014eb7b5f3fa735bdede8
++ NEW_COMMIT=3eae0a2f101d06f0ccd99e7458c4715ceae97e47
++ git replace main 3eae0a2f101d06f0ccd99e7458c4715ceae97e47
++ echo more
++ git add othername
++ git commit -qm more
++ git fast-export --all
++ sed -e s/othername/somename/ tmp
++ git fast-import --force
++ grep 'Dropping.*since it would point to itself' msgs
warning: Dropping refs/replace/fcc7def4c7c8d77417a8e1bca848b7a8f89a9254 since it would point to itself (i.e. to fcc7def4c7c8d77417a8e1bca848b7a8f89a9254)
++ git show-ref
++ grep refs/replace refs
ok 254 - X: replace ref that becomes useless is removed
expecting success of 9300.255 'Y: setup':
test_oid_cache <<-EOF
Ymain sha1:9afed2f9161ddf416c0a1863b8b0725b00070504
Ymain sha256:c0a1010da1df187b2e287654793df01b464bd6f8e3f17fc1481a7dadf84caee3
EOF
++ test_oid_cache
++ local tag rest k v
++ test -n sha1
++ read tag rest
++ case $tag in
++ k=sha1
++ v=9afed2f9161ddf416c0a1863b8b0725b00070504
++ expr sha1 : '[a-z0-9][a-z0-9]*$'
++ eval 'test_oid_sha1_Ymain="$v"'
+++ test_oid_sha1_Ymain=9afed2f9161ddf416c0a1863b8b0725b00070504
++ read tag rest
++ case $tag in
++ k=sha256
++ v=c0a1010da1df187b2e287654793df01b464bd6f8e3f17fc1481a7dadf84caee3
++ expr sha256 : '[a-z0-9][a-z0-9]*$'
++ eval 'test_oid_sha256_Ymain="$v"'
+++ test_oid_sha256_Ymain=c0a1010da1df187b2e287654793df01b464bd6f8e3f17fc1481a7dadf84caee3
++ read tag rest
ok 255 - Y: setup
expecting success of 9300.256 'Y: rewrite submodules':
git init main1 &&
(
cd main1 &&
git init sub2 &&
git -C sub2 fast-import --export-marks=../sub2-marks <../Y-sub-input &&
git fast-import --rewrite-submodules-from=sub:../Y-marks \
--rewrite-submodules-to=sub:sub2-marks <../Y-main-input &&
test "$(git rev-parse main)" = "$(test_oid Ymain)"
)
++ git init main1
Initialized empty Git repository in /var/tmp/b/git/t/trash directory.t9300-fast-import/testrepo/main1/.git/
++ cd main1
++ git init sub2
Initialized empty Git repository in /var/tmp/b/git/t/trash directory.t9300-fast-import/testrepo/main1/sub2/.git/
++ git -C sub2 fast-import --export-marks=../sub2-marks
Unpacking objects: 100% (6/6), 412 bytes | 103.00 KiB/s, done.
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 6 ( 0 duplicates )
blobs : 2 ( 0 duplicates 0 deltas of 0 attempts)
trees : 2 ( 0 duplicates 0 deltas of 1 attempts)
commits: 2 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 4 unique )
atoms: 1
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 0
pack_report: pack_mmap_calls = 0
pack_report: pack_open_windows = 0 / 0
pack_report: pack_mapped = 0 / 0
---------------------------------------------------------------------
++ git fast-import --rewrite-submodules-from=sub:../Y-marks --rewrite-submodules-to=sub:sub2-marks
Unpacking objects: 100% (9/9), 747 bytes | 124.00 KiB/s, done.
fast-import statistics:
---------------------------------------------------------------------
Alloc'd objects: 5000
Total objects: 9 ( 0 duplicates )
blobs : 3 ( 0 duplicates 0 deltas of 1 attempts)
trees : 3 ( 0 duplicates 2 deltas of 2 attempts)
commits: 3 ( 0 duplicates 0 deltas of 0 attempts)
tags : 0 ( 0 duplicates 0 deltas of 0 attempts)
Total branches: 1 ( 1 loads )
marks: 1024 ( 12 unique )
atoms: 3
Memory total: 2493 KiB
pools: 2141 KiB
objects: 351 KiB
---------------------------------------------------------------------
pack_report: getpagesize() = 4096
pack_report: core.packedGitWindowSize = 1073741824
pack_report: core.packedGitLimit = 35184372088832
pack_report: pack_used_ctr = 0
pack_report: pack_mmap_calls = 0
pack_report: pack_open_windows = 0 / 0
pack_report: pack_mapped = 0 / 0
---------------------------------------------------------------------
+++ git rev-parse main
+++ test_oid Ymain
+++ local algo=sha1
+++ case "$1" in
+++ local var=test_oid_sha1_Ymain
+++ eval 'test -z "${test_oid_sha1_Ymain+set}"'
++++ test -z set
+++ eval 'printf '\''%s\n'\'' "${test_oid_sha1_Ymain}"'
++++ printf '%s\n' 9afed2f9161ddf416c0a1863b8b0725b00070504
++ test 9afed2f9161ddf416c0a1863b8b0725b00070504 = 9afed2f9161ddf416c0a1863b8b0725b00070504
ok 256 - Y: rewrite submodules
# failed 4 among 256 test(s)
1..256
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment