Skip to content

Commit 565fb8d

Browse files
Edward Thomsoncarlosmn
authored andcommitted
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.
1 parent e8ab13b commit 565fb8d

15 files changed

+64
-4
lines changed

tests/odb/foreach.c

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -28,8 +28,8 @@ static int foreach_cb(const git_oid *oid, void *data)
2828

2929
/*
3030
* $ git --git-dir tests/resources/testrepo.git count-objects --verbose
31-
* count: 47
32-
* size: 4
31+
* count: 60
32+
* size: 240
3333
* in-pack: 1640
3434
* packs: 3
3535
* size-pack: 425
@@ -44,7 +44,7 @@ void test_odb_foreach__foreach(void)
4444
git_repository_odb(&_odb, _repo);
4545

4646
cl_git_pass(git_odb_foreach(_odb, foreach_cb, &nobj));
47-
cl_assert_equal_i(47 + 1640, nobj); /* count + in-pack */
47+
cl_assert_equal_i(60 + 1640, nobj); /* count + in-pack */
4848
}
4949

5050
void test_odb_foreach__one_pack(void)
@@ -118,7 +118,7 @@ void test_odb_foreach__files_in_objects_dir(void)
118118

119119
cl_git_pass(git_repository_odb(&odb, repo));
120120
cl_git_pass(git_odb_foreach(odb, foreach_cb, &nobj));
121-
cl_assert_equal_i(47 + 1640, nobj); /* count + in-pack */
121+
cl_assert_equal_i(60 + 1640, nobj); /* count + in-pack */
122122

123123
git_odb_free(odb);
124124
git_repository_free(repo);

tests/resources/testrepo.git/objects/43/da5ec3274dd061df152ff5e69853d562b01842

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
x-�]jC!F��*f)�]��@�
2+
��8� �Z��ۯi�v��>����Os0�B%s)f���M�l�h�V4�5������ �&4ѕ@:�D�)oIr`���$�L����Y��w�s¥F��������g������`�$��b����o�;� �����U|����zO��u}��/�._���ׁ~����J

tests/resources/testrepo.git/objects/43/e968a905a821532069bb413801d35b200631cf

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
x��K
2+
1]�}%�N'7�� ��� 8����
3+
���\�u�5zc���6��8�b,��D�2�0�'�Q�b㭃�@ҩ�R��Q�[��94�)��q�smp+��
4+
�纾�g�G����=�r]/��3�((��tR�a������>���E�
Binary file not shown.
Binary file not shown.

tests/resources/testrepo.git/objects/8e/73b769e97678d684b809b163bebdae2911720f

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
x���j�0�S�)��*a���㚔��+��l8[A�������33������y�M$�m�*�� �$q��G?Y�A�5<��t����8r���5�����7nD#.d��)~�N�0˄�)R,�|,h��jQ*t������C~� |�u���zҧ�ݗ>����
2+
ƒ�d����8��\�����S�]!7�� ����s� ,[�P2�fw^�

tests/resources/testrepo.git/objects/b2/04707bbc546a1a770ef6ced37c7089cc3bfe6b

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
x-�]��0 �}�)t�.�Q J),{���-7��^\�^�ҷA�7(���F�W�"��A%�ɣy���g�iTI��d�?_�����#��[��(-�D�0wdp����R*\Bi~�����[���;�|m�a�djRj���a�
2+
���k��R�s���t��m��G"7��{�~��LD�
Binary file not shown.
Binary file not shown.
Binary file not shown.

0 commit comments

Comments
 (0)