tests: generate test resources for reftables

Generate test resources for reftables. These resources are basically the
Git repositories we already have, but converted to use the "reftable"
format. For most of the part, this conversion is done by executing `git
refs migrate`.

A couple notes:

  - This require a recent Git upstream version with not-yet-upstreamed
    patches due to a bug in `git refs migrate` with reflogs.

  - The migration command does not yet support repositories with
    worktrees. Those were converted by first removing the worktrees,
    migrating the refs and then recreating them.

  - The HEAD_TRACKER reference in testrepo.git is not recognized as a
    root ref and is thus not automatically migrated.

  - testrepo.git has an empty reflog for refs/heads/with-empty-log that
    does not get migrated.
This commit is contained in:
Patrick Steinhardt
2025-07-22 12:59:36 +02:00
parent ee0972cac8
commit 415f3fbdb0
3099 changed files with 4591 additions and 0 deletions

View File

@@ -0,0 +1 @@
ref: refs/heads/.invalid

View File

@@ -0,0 +1,8 @@
[core]
repositoryformatversion = 1
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
[extensions]
refstorage = reftable

View File

@@ -0,0 +1 @@
Unnamed repository; edit this file 'description' to name the repository.

Binary file not shown.

View File

@@ -0,0 +1,4 @@
* repoattr
a* foo !bar -baz
sub/*.txt reposub
sub/sub/*.txt reposubsub

View File

@@ -0,0 +1,6 @@
# git ls-files --others --exclude-from=.git/info/exclude
# Lines that start with '#' are comments.
# For a project mostly in C, the following would be a good set of
# exclude patterns (uncomment them if you want to use them):
# *.[oa]
# *~

View File

@@ -0,0 +1,4 @@
xťŽQ
Â0DýÎ)öęn“ŘDÄ#x<>mv<6D>…ÖJŢ߀7đcx0Ľ<30>IۺΠ­¨‚óž-ąĚÁń+e"ĽÁ‡śâ<C59B>ťůpŃwŽcJH1x‡Ô%Ś”¦HL>Ddˇ‰ ďíµxîµę˛ŔC—¬®\ʤz˙á”¶ődí0Zŕ<E28098>#˘ém˙ŘşţĎÚ°<C39A>
äyŃ
óę>ť{ĚqK˛

View File

@@ -0,0 +1 @@
xmPΡj„0μ«ω<C2AB>=ϊP8Z…ήSΎ¤”c£ρ hR6{=Ό―obβ™<CEB2>"<22>Ωafv<66><76><EFBFBD>χΧζιδ#3‰Ξ¬=7P<37>%[8<Heμ`&]@?aFZ<04>®<EFBFBD>η@!…χ.ΚΘω:±ω½§…•ldπΪLG­|K7~XΓN8¤<38>·IΟκ}Ώψ<CE8F>q<EFBFBD>σ2cGΎ<>7lΎ5ΤV_pEϋ<45>®#lZ΄<5A>GMςt[JΜΘΝΒ½¥&©hΈ±uΜ][‰Φί4‰-3;ΛC<CE9B>g<EFBFBD>4Ώx`Zΐ»YΓ<59>ι<E2809C>»ϊ€bέ^>ο yNlΝ£΅>c―;gΣ<67>¥kΗYXΔ9b|D<>~VΨ—)…vΏψρΞά•

View File

@@ -0,0 +1,2 @@
xÁÁ € @ßWŶàÇ
|ø§k 9n$¡}gŠ«à:<3A>‡îÂ;5°1¥e4ˆ\k_]ÞƒŸÙ­hœD¡ký'~

View File

@@ -0,0 +1,2 @@
x²Nш б0Ц;Sэ═к╩∙B▄ю≈кU ╔╢JсЩ ╟?╤lы√y≥Гgcц║U RbaБ░ыcG;╦l╡Ц═²Dqж═Z╘й╚AH■<г▒Ёв3NБ╗ЦД=J2d3[⌠0⌠╒╫=√
В}ш╓╦I≥╓б≥jM"в²x≥/═╜И[г▌ьГTwШгжЦЪ╢U║&[┐/ЛkЧ(УtJL

View File

@@ -0,0 +1,3 @@
x<01><>Û Ã0 Eûí)´@d'~@(¥#tÅQ¨ÁiÀQö¯¡ôëÂánÞ·­(Pôm"<22>Řh°s L+<2B>d{—"{Zœ“`øÔ÷Þàu‡Ô
O©«4˜¸µYäñ[Þ·;<3B>³Ã@>¥®M§ýS»þOmʧhá
*‡ÂÂÊæ ¿<-

View File

@@ -0,0 +1 @@
x<01><>Kj1D<><44>)zol<6F>i<EFBFBD><69> _"hi<68>K2<4B>L<EFBFBD><4C>G!7Ȫ<05><><EFBFBD>J<EFBFBD>,<2C><><EFBFBD>E<EFBFBD>PX<50><58>D<EFBFBD><44>S<EFBFBD><53> ] /)<29><>}<7D><>/<2F><>Uw<55>R<EFBFBD><52>. <09>j<EFBFBD><6A><13><>p<EFBFBD><70><EFBFBD><EFBFBD>#<23><>#:?<3F><>:|<7C><>;<3B><>F9<46>܋<EFBFBD>r=_ <0B><>)<29><>ơ<>N/<2F><>A[<5B><>l<EFBFBD><6C>!<21>q<EFBFBD><71>}<7D><><EFBFBD><15><Lfx4<78>H\<5C><>\<5C><>q֏cj<63><6A><EFBFBD><EFBFBD><04>T<EFBFBD>

View File

@@ -0,0 +1 @@
x5Ž1Â0 E™}Š?΀;•˜<53>ˆÔ®”ŠÛ“Ðv´ýߢ8ŸO‡'FÈÈ:2r™<72>ƒ)(¾ &¢Þ·«×9Z¼A Âð³¼Ñ¹<C391>r9Ýl¬ %¨˜ˆ„3ÑE<17>o<6F>£.ÿV­Õi<Bñà F­©MÌb‰®Ã™Ÿ*vµªÛþìÖmõ÷¾¢ÞLK†Ý­D?+­N

View File

@@ -0,0 +1,4 @@
x<01>Ž]
!E{v³<>B>!"ZB;u¤à3Cmÿ í § ‡{.7µZŸ4âavfÈÖgBLÊEeP;NQÚ¬BŒLAnŲIÆç ÞÔù5ÁI»)MÑ6Z•œQ[
h3Úe:
 ùì}æ£u¸Æà}‡ï…;œ©÷È|ýÅ)µzµ&ô¦¼Óp””bÑõq®ú?¶¨­3TJ½Áä1‡ø3ÙJX

View File

@@ -0,0 +1,2 @@
xťŽQjÄ0 DűíSč[ähc;PJéÚ(˛Ľ $q°Ţľ†Ţ _3oŕIŢ÷µÁŕÜK+ŞŕâäBt<42>„I|ś”â»LěgçĆ<C3A7>Ö Ĺ<>R4'=¤qFN6Í÷4
JôĚ1ôÖFr<46>ŃzĂW[r<>Ż«VÝ6řÔ-i<>7.eVýřWÉű;X‰,Á ˘émwl˙ĎŰ|ç]ṬMëɢ<C389>ŹídáăˇRwęC[ŹśW9sŐj~Wy

View File

@@ -0,0 +1,2 @@
x5<>A
Â0D]ÿSÌεèoàÂuJ~L0ýͯ¡··)¸xÃcfªœp¹]OOΊcñB µ˜6»!뢘´²Ã³‚{,áU<C¿j˜¹[ÁE-ŠÜ-¢Ò˜ð&#š¯)<29>~ëÇäÆ=˜<>;;{.öùe"3A

View File

@@ -0,0 +1,2 @@
x<01>N[j1 Ì·O¡ 4ÈRbÇPJÈ
=€Ö;NûÂë½ ½A?†y 1“×y~7½žZ(¾¥2ªÏð£beàÁ8uåJa‰n³Š¥F.HÈ"— UD_®Ý£÷ÉHI£sv´×ZéûØwL=0´ZàþGç¼Î_äUbßKèƒoÌ®§}cëçÿùv?Ûhí½<©aoÔµ¹_áEK

View File

@@ -0,0 +1 @@
x5ЋAВ0 ы„xBЬAвњG¤vХ¤Tьћ¤РЈеќќхЩ<ыгоВ#ҐО1ВUTй‡*СMъWlОOCR<43>2dЦСµC.„T“©ЛИI№ќlQH/цњmYЫ¬UN[аћЄЂЯ¬¬ҐюBЦ@t¶Ьр8~<7E>Х‹ї}}R#ДЌ#kAШdD_=-H

View File

@@ -0,0 +1 @@
this repository uses the reftable format

View File

@@ -0,0 +1 @@
0x000000000001-0x000000000009-c6dbd6c2.ref

1
tests/resources/reftable/attr/attr0 vendored Normal file
View File

@@ -0,0 +1 @@
* binary

29
tests/resources/reftable/attr/attr1 vendored Normal file
View File

@@ -0,0 +1,29 @@
# a comment followed by some blank lines
# another comment that is indented
# variations on fnmatch
pat0 attr0
!pat1 attr1
pat2/ attr2
pat3dir/pat3file attr3
pat4.* attr4
*.pat5 attr5
pat6/pat6/*.pat6 attr6
pat7[a-e]??[xyz] attr7 # with a comment on the line
pat8\ with\ spaces attr8
invalid # attr with no assignments doesn't count
also/invalid
invalid.again/
# next attr is at eof
pat9 attr9

21
tests/resources/reftable/attr/attr2 vendored Normal file
View File

@@ -0,0 +1,21 @@
# variations on assignments
pat0 simple
pat1 -neg
* notundef
pat2 !notundef
pat3 assigned=test-value
pat4 rule-with-more-chars=value-with-more-chars
pat5 empty=
pat6 -negempty=
pat7 multiple -single values=1 also=a-really-long-value/* happy=yes!
# the next line has trailing spaces
pat8 again= another=12321
patbad0 # empty assignment does not count
# next line will be another simple empty assign that should not count
patbad1
# BTW I think there are 11 valid rules and two "invalid" empty ones
pat9 -at-eof

4
tests/resources/reftable/attr/attr3 vendored Normal file
View File

@@ -0,0 +1,4 @@
# These are examples from the git-check-attr.1 man page
*.java diff=java -crlf myAttr
NoMyAttr.java !myAttr
README caveat=unspecified

7
tests/resources/reftable/attr/attr4 vendored Normal file
View File

@@ -0,0 +1,7 @@
# This is a comment
# This is also a comment
*.java diff=java -crlf myAttr
NoMyAttr.java !myAttr
README caveat=unspecified

1
tests/resources/reftable/attr/binfile vendored Normal file
View File

@@ -0,0 +1 @@
123

View File

1
tests/resources/reftable/attr/file vendored Normal file
View File

@@ -0,0 +1 @@
hi

View File

@@ -0,0 +1,29 @@
* rootattr
root_test2 -rootattr
root_test3 !rootattr
binfile binary
abc foo bar baz
does-not-exist foo=yes
root_test2 multiattr
root_test3 multi2=foo
root_test3 multiattr=1 multiattr=2 multiattr=3 multi2=abc !multi2
root_test2 multiattr=string -multiattr
[attr]mymacro positive -negative !rootattr
macro* mymacro another=77
[attr]macro2 multi2 -multi2 multi3 !multi3 multi3=answer
macro* macro2 macro2 macro2
# let's try some malicious macro defs
[attr]firstmacro -thirdmacro -secondmacro
[attr]secondmacro firstmacro -firstmacro
[attr]thirdmacro secondmacro=hahaha
macro_bad firstmacro secondmacro thirdmacro
# another test that Peff found was failing
[attr]notest !test

View File

@@ -0,0 +1,2 @@
ign
dir/

1
tests/resources/reftable/attr/ign vendored Normal file
View File

@@ -0,0 +1 @@
ignore me

View File

@@ -0,0 +1 @@
boo

View File

@@ -0,0 +1 @@
Yo

View File

@@ -0,0 +1 @@
Hello from the root

View File

@@ -0,0 +1,6 @@
Hello from the root
Some additional lines
Down here below

View File

@@ -0,0 +1,19 @@
Some additional lines
Down here below the other lines
With even more at the end
And lots of good stuff
Anywhere you want
Don't you think

View File

@@ -0,0 +1,14 @@
Here is some stuff at the start
This should go in one hunk (first)
Some additional lines
Down here below the other lines
With even more at the end
Followed by a second hunk of stuff (second)
That happens down here

View File

@@ -0,0 +1,7 @@
* subattr=yes -negattr
*.txt another=zero
sub/*.txt another=one
ab* merge=filfre
abc -foo -bar
*.c frotz
deep/file deepdeep

37
tests/resources/reftable/attr/sub/abc vendored Normal file
View File

@@ -0,0 +1,37 @@
# Test file from gitattributes(5) example:
If you have these three gitattributes file:
(in $GIT_DIR/info/attributes)
a* foo !bar -baz
(in .gitattributes)
abc foo bar baz
(in t/.gitattributes)
ab* merge=filfre
abc -foo -bar
*.c frotz
the attributes given to path t/abc are computed as follows:
1. By examining t/.gitattributes (which is in the same directory as the path
in question), git finds that the first line matches. merge attribute is
set. It also finds that the second line matches, and attributes foo and
bar are unset.
2. Then it examines .gitattributes (which is in the parent directory), and
finds that the first line matches, but t/.gitattributes file already
decided how merge, foo and bar attributes should be given to this path,
so it leaves foo and bar unset. Attribute baz is set.
3. Finally it examines $GIT_DIR/info/attributes. This file is used to
override the in-tree settings. The first line is a match, and foo is set,
bar is reverted to unspecified state, and baz is unset.
As the result, the attributes assignment to t/abc becomes:
foo set to true
bar unspecified
baz set to false
merge set to string value "filfre"
frotz unspecified

View File

View File

@@ -0,0 +1 @@
hi

View File

@@ -0,0 +1 @@
in ignored dir

View File

@@ -0,0 +1 @@
below ignored dir

View File

@@ -0,0 +1,3 @@
d/* test=a/b/d/*
d/yes notest

View File

View File

@@ -0,0 +1 @@
hi

View File

@@ -0,0 +1 @@
subsub

View File

@@ -0,0 +1,2 @@
Hello from the subdir

View File

@@ -0,0 +1 @@
Hello again

View File

@@ -0,0 +1 @@
ref: refs/heads/.invalid

View File

@@ -0,0 +1,8 @@
[core]
repositoryformatversion = 1
filemode = true
bare = false
logallrefupdates = true
ignorecase = true
[extensions]
refstorage = reftable

View File

@@ -0,0 +1 @@
Unnamed repository; edit this file 'description' to name the repository.

Binary file not shown.

View File

@@ -0,0 +1,6 @@
# git ls-files --others --exclude-from=.git/info/exclude
# Lines that start with '#' are comments.
# For a project mostly in C, the following would be a good set of
# exclude patterns (uncomment them if you want to use them):
# *.[oa]
# *~

View File

@@ -0,0 +1 @@
58f7cf825b553ef7c26e5b9f8a23599c1a9ca296 refs/heads/master

View File

@@ -0,0 +1,3 @@
x<>[
Γ ν*ά@<>PJι
]€<>™&“`ΜώλϊwΈ<77> 'o¥ΜMΈK«D qΚΛμ5DFΛ#<23>δ!!<21>=VZDΟL<>†:ƒ%L<>}ƒ!dC<>¬<>g¶*ίηqΠ²Θ-LUήkz~η6<CEB7>ι·ς<C2B7>Ϊ«νΰ<06>Wε”}ν}­«<C2AD>>Εg<CE95>ΛΎΥ{f<>βϊ%ρ ΅Gς

View File

@@ -0,0 +1 @@
x ÃÑ €0 @¿<>âÍà‡“¸@kR@ßÂ]½ã<¶K4±ÜnÕÔÅY‰á<E280B0>)l(a¨hF˜Hcƒcÿ<18>

Some files were not shown because too many files have changed in this diff Show More