From 565fb8dcd41eefb373ec6dc71dc2f19884d29cdc Mon Sep 17 00:00:00 2001 From: Edward Thomson Date: Sat, 25 Jun 2016 20:02:45 -0400 Subject: [PATCH] revwalk: introduce tests that hide old commits Introduce some tests that show some commits, while hiding some commits that have a timestamp older than the common ancestors of these two commits. --- tests/odb/foreach.c | 8 +-- .../43/da5ec3274dd061df152ff5e69853d562b01842 | Bin 0 -> 193 bytes .../43/e968a905a821532069bb413801d35b200631cf | Bin 0 -> 158 bytes .../5d/0f8f7891e872d284beef38254882dc879b2602 | Bin 0 -> 149 bytes .../5f/34cd6e3285089647165983482cf90873d50940 | Bin 0 -> 37 bytes .../8e/73b769e97678d684b809b163bebdae2911720f | Bin 0 -> 209 bytes .../b2/04707bbc546a1a770ef6ced37c7089cc3bfe6b | Bin 0 -> 184 bytes .../b2/35959d89084af8d3544fbdf675e47944f86524 | Bin 0 -> 77 bytes .../b9/1e763008b10db366442469339f90a2b8400d0a | Bin 0 -> 206 bytes .../bd/758010071961f28336333bc41e9c64c9a64866 | Bin 0 -> 162 bytes .../db/4df74a2fc340a0d0cb0cafc0db471fdfff1048 | Bin 0 -> 192 bytes .../db/793a00a5615eca1aac97e42b3a68b1acfa8bfd | Bin 0 -> 193 bytes .../db/c0be625bed24b5d8f5d9a927484f2065d321af | Bin 0 -> 175 bytes .../f0/a2a10243ca64f935dbe3dccb89ec8bf16bdace | Bin 0 -> 38 bytes tests/revwalk/basic.c | 48 ++++++++++++++++++ 15 files changed, 52 insertions(+), 4 deletions(-) create mode 100644 tests/resources/testrepo.git/objects/43/da5ec3274dd061df152ff5e69853d562b01842 create mode 100644 tests/resources/testrepo.git/objects/43/e968a905a821532069bb413801d35b200631cf create mode 100644 tests/resources/testrepo.git/objects/5d/0f8f7891e872d284beef38254882dc879b2602 create mode 100644 tests/resources/testrepo.git/objects/5f/34cd6e3285089647165983482cf90873d50940 create mode 100644 tests/resources/testrepo.git/objects/8e/73b769e97678d684b809b163bebdae2911720f create mode 100644 tests/resources/testrepo.git/objects/b2/04707bbc546a1a770ef6ced37c7089cc3bfe6b create mode 100644 tests/resources/testrepo.git/objects/b2/35959d89084af8d3544fbdf675e47944f86524 create mode 100644 tests/resources/testrepo.git/objects/b9/1e763008b10db366442469339f90a2b8400d0a create mode 100644 tests/resources/testrepo.git/objects/bd/758010071961f28336333bc41e9c64c9a64866 create mode 100644 tests/resources/testrepo.git/objects/db/4df74a2fc340a0d0cb0cafc0db471fdfff1048 create mode 100644 tests/resources/testrepo.git/objects/db/793a00a5615eca1aac97e42b3a68b1acfa8bfd create mode 100644 tests/resources/testrepo.git/objects/db/c0be625bed24b5d8f5d9a927484f2065d321af create mode 100644 tests/resources/testrepo.git/objects/f0/a2a10243ca64f935dbe3dccb89ec8bf16bdace diff --git a/tests/odb/foreach.c b/tests/odb/foreach.c index 12b81b4f1..42d706467 100644 --- a/tests/odb/foreach.c +++ b/tests/odb/foreach.c @@ -28,8 +28,8 @@ static int foreach_cb(const git_oid *oid, void *data) /* * $ git --git-dir tests/resources/testrepo.git count-objects --verbose - * count: 47 - * size: 4 + * count: 60 + * size: 240 * in-pack: 1640 * packs: 3 * size-pack: 425 @@ -44,7 +44,7 @@ void test_odb_foreach__foreach(void) git_repository_odb(&_odb, _repo); cl_git_pass(git_odb_foreach(_odb, foreach_cb, &nobj)); - cl_assert_equal_i(47 + 1640, nobj); /* count + in-pack */ + cl_assert_equal_i(60 + 1640, nobj); /* count + in-pack */ } void test_odb_foreach__one_pack(void) @@ -118,7 +118,7 @@ void test_odb_foreach__files_in_objects_dir(void) cl_git_pass(git_repository_odb(&odb, repo)); cl_git_pass(git_odb_foreach(odb, foreach_cb, &nobj)); - cl_assert_equal_i(47 + 1640, nobj); /* count + in-pack */ + cl_assert_equal_i(60 + 1640, nobj); /* count + in-pack */ git_odb_free(odb); git_repository_free(repo); diff --git a/tests/resources/testrepo.git/objects/43/da5ec3274dd061df152ff5e69853d562b01842 b/tests/resources/testrepo.git/objects/43/da5ec3274dd061df152ff5e69853d562b01842 new file mode 100644 index 0000000000000000000000000000000000000000..298feece49d7e4f368998e5147893df4f2c34a12 GIT binary patch literal 193 zcmV;y06zbC0WFSQYC|CqM*Hk4W&Ib~s=oik{7WdC*>g^Sj_7;`FVBsXalwz&x;p72t v`8$pbAGNpJ!{$|d(D}O0dQbnpbq;;d+ArTOU!)Nas_@r=ez5of)#OSW3n64z literal 0 HcmV?d00001 diff --git a/tests/resources/testrepo.git/objects/43/e968a905a821532069bb413801d35b200631cf b/tests/resources/testrepo.git/objects/43/e968a905a821532069bb413801d35b200631cf new file mode 100644 index 0000000000000000000000000000000000000000..ec04abf681024c5e3b293261ef7d871c5da8b66c GIT binary patch literal 158 zcmV;P0Ac@l0iBLZ3IZ_@1zqP9eE}t(PA35oH{QSt7X?pdSiy9jSV&wAEd`P`C=^Ml*&ZTGP*E^C#zAsV&koY$3W7ltP)c87L!rRTaLjw zG>Iwt0izRf?{jT%E1%d3+~>N!>jq~Y_D9#p(&s&$a$PT=v@@D0D1xJOQi@^6%g+Dy MqCSiG07F=Q|_FfcPQQ3!H%bn$g%5N`dHvVMD1*wTH+ot*d0HmhE8 zio?VJ2ow^N7(P11yjPSt(6h?$`BvBen~c_Mm~j}YJ*g-$FF7MVEi)%oucV@c!F6Zz zKC|sM>>YRJ?Ae~PyWvmuhH$9Tywq~Ak`Id(GC7}0`DuFl@txD1Z@NEb-#P~X4@N+M D#z04o literal 0 HcmV?d00001 diff --git a/tests/resources/testrepo.git/objects/5f/34cd6e3285089647165983482cf90873d50940 b/tests/resources/testrepo.git/objects/5f/34cd6e3285089647165983482cf90873d50940 new file mode 100644 index 0000000000000000000000000000000000000000..b1df3bdd5cf408c6a576fa3041938b194b268734 GIT binary patch literal 37 vcmV+=0NVd}0ZYosPf{>4W(dj1ELH%b#5{%koD_wmqQt!93`H&goVE$TEmshD literal 0 HcmV?d00001 diff --git a/tests/resources/testrepo.git/objects/8e/73b769e97678d684b809b163bebdae2911720f b/tests/resources/testrepo.git/objects/8e/73b769e97678d684b809b163bebdae2911720f new file mode 100644 index 0000000000000000000000000000000000000000..d75977a25d492bdfcfafc9ea58982cfd5beada91 GIT binary patch literal 209 zcmV;?051P{0iBS&YQ!)Qgj4$|w!11}^}7~?J|@&YUE`fNB`L6*tu$JgWm(hVOo z12d(r>(arYdFf3RBp1vYZOAIt=OE)0ByqCjM?YDNL7X)_4d2{!>)@THIC8?kqcy>u zj+C=EZbTz4WQ!P`DSv*7PRKCJgo!By6H+XRd@N|al4?;ZboTSn=i1;yez*yI&2`=D z2Jd>(r@GyjJ|Fq5)b$F+lCxyI5AceFIGprc)%Cym;ZxgPAvfO2443`L&vW(*EL*Qo LA2R#`W_Mo1f`V*1 literal 0 HcmV?d00001 diff --git a/tests/resources/testrepo.git/objects/b2/04707bbc546a1a770ef6ced37c7089cc3bfe6b b/tests/resources/testrepo.git/objects/b2/04707bbc546a1a770ef6ced37c7089cc3bfe6b new file mode 100644 index 0000000000000000000000000000000000000000..f9ec61c1e2c805779a27b5ec0170af4d2c3b389e GIT binary patch literal 184 zcmV;p07w6L0WHp5io-Ar1mJznDRhA@{!tVQN+~RRg7yNAEjNL>UR;M>f1T2|LCiNO zl$_TFM$=cTBEX12B@&FuqaJw_lGz545NC~PR7tecWQIRq<6WiT`_Ff%bx2y%6F@pWYoZvB+9etT5d(tXFBocGN(t6p-7 j1F9lFCxs#2r13djB-Bl`UFwXBD&G1 znbAz`>$(iE);)|}6{J)w8pszFa>Yw*UQ$lPF1kh-yjU{1O&@vJZ2$)=Y;u-{DRc71 zr%)5SP?4OnYE`cM>vvXDh&iFpk&L%TV=BcN8_|gMg%E=^wN3dx=Dx$LeCA!?eeUb6 zZ}6-K{Z=oRWz6^TRQq}cLu`qSa~>X%5vPM5uZI3NKfURGQTVBW(_crQVA)28eifR& I02(=EX>-VC7sl_|4+y#`=hEw^H@Na)e{`Q;W7(!l>h%W7dQZVQqu?y9l;W_*<=}sN Q(Rhcn#5S||0*`k|){{(4dH?_b literal 0 HcmV?d00001 diff --git a/tests/resources/testrepo.git/objects/db/4df74a2fc340a0d0cb0cafc0db471fdfff1048 b/tests/resources/testrepo.git/objects/db/4df74a2fc340a0d0cb0cafc0db471fdfff1048 new file mode 100644 index 0000000000000000000000000000000000000000..5f3d50efa28b5b1c8ec01cf0b9a23deae7384cd9 GIT binary patch literal 192 zcmV;x06+hD0WHo^N(3mvq6uhFO z)w&OGo*qV51*h>A)+ zAuENm7fzN{$i&+yt;4&tG2pdCX$L%Cr!a3a7 zYTXAIYo12W8G@z|Rz@EpT3wvZ2?NVgI5^9hSF6bqCH2KU-v$sHG-An#U=d8>b162K zlEp@k!Xn8aEsBq^wGQvGjRBX9W4po2J^sS^T6zC`j;+3eHlDoE%d)}=J))ZHd^mE4 vxAe_D!N=C>{bA=>e9-y2kL{3upPUOmtiey8rmq-EJNnq*ucUqeBnL|0%C}%Q literal 0 HcmV?d00001 diff --git a/tests/resources/testrepo.git/objects/db/c0be625bed24b5d8f5d9a927484f2065d321af b/tests/resources/testrepo.git/objects/db/c0be625bed24b5d8f5d9a927484f2065d321af new file mode 100644 index 0000000000000000000000000000000000000000..b966b0b2fda7c481c94a110b27d32c6f7484aa4c GIT binary patch literal 175 zcmV;g08syU0V^p=O;s>7H)1d}FfcPQQ3!H%bn$g%5N`dHvVMD1*wTH+ot*d0HmhE8 zio?VJ2ow^N7(P11yjPSt(6h?$`BvBen~c_Mm~j}YJ*g-$FF7MVEi)%oucV@c!F6Zz zKC|sM>>YRJ?Ae~PyWvmuhH$9Tywq~Al3$)1%BL$&TpPh$5b$Yve97ZJ d@g`^Uj9NLSxr;?Md+7Y+D89<+008njM;gt0RR;h7 literal 0 HcmV?d00001 diff --git a/tests/resources/testrepo.git/objects/f0/a2a10243ca64f935dbe3dccb89ec8bf16bdace b/tests/resources/testrepo.git/objects/f0/a2a10243ca64f935dbe3dccb89ec8bf16bdace new file mode 100644 index 0000000000000000000000000000000000000000..1b299dc257b712a486bb7ec5bd07720d88001374 GIT binary patch literal 38 ucmbxW_q