PageRenderTime 57ms CodeModel.GetById 31ms RepoModel.GetById 0ms app.codeStats 0ms

/tests/revwalk/basic.c

http://github.com/libgit2/libgit2
C | 627 lines | 380 code | 154 blank | 93 comment | 37 complexity | 87c08e3e1fac27e51440145a38502066 MD5 | raw file
Possible License(s): LGPL-2.1, MIT, CC0-1.0
  1. #include "clar_libgit2.h"
  2. /*
  3. * a4a7dce [0] Merge branch 'master' into br2
  4. |\
  5. | * 9fd738e [1] a fourth commit
  6. | * 4a202b3 [2] a third commit
  7. * | c47800c [3] branch commit one
  8. |/
  9. * 5b5b025 [5] another commit
  10. * 8496071 [4] testing
  11. */
  12. static const char *commit_head = "a4a7dce85cf63874e984719f4fdd239f5145052f";
  13. static const char *commit_ids[] = {
  14. "a4a7dce85cf63874e984719f4fdd239f5145052f", /* 0 */
  15. "9fd738e8f7967c078dceed8190330fc8648ee56a", /* 1 */
  16. "4a202b346bb0fb0db7eff3cffeb3c70babbd2045", /* 2 */
  17. "c47800c7266a2be04c571c04d5a6614691ea99bd", /* 3 */
  18. "8496071c1b46c854b31185ea97743be6a8774479", /* 4 */
  19. "5b5b025afb0b4c913b4c338a42934a3863bf3644", /* 5 */
  20. };
  21. /* Careful: there are two possible topological sorts */
  22. static const int commit_sorting_topo[][6] = {
  23. {0, 1, 2, 3, 5, 4}, {0, 3, 1, 2, 5, 4}
  24. };
  25. static const int commit_sorting_time[][6] = {
  26. {0, 3, 1, 2, 5, 4}
  27. };
  28. static const int commit_sorting_topo_reverse[][6] = {
  29. {4, 5, 3, 2, 1, 0}, {4, 5, 2, 1, 3, 0}
  30. };
  31. static const int commit_sorting_time_reverse[][6] = {
  32. {4, 5, 2, 1, 3, 0}
  33. };
  34. /* This is specified unsorted, so both combinations are possible */
  35. static const int commit_sorting_segment[][6] = {
  36. {1, 2, -1, -1, -1, -1}, {2, 1, -1, -1, -1, -1}
  37. };
  38. #define commit_count 6
  39. static const int result_bytes = 24;
  40. static int get_commit_index(git_oid *raw_oid)
  41. {
  42. int i;
  43. char oid[GIT_OID_HEXSZ];
  44. git_oid_fmt(oid, raw_oid);
  45. for (i = 0; i < commit_count; ++i)
  46. if (memcmp(oid, commit_ids[i], GIT_OID_HEXSZ) == 0)
  47. return i;
  48. return -1;
  49. }
  50. static int test_walk_only(git_revwalk *walk,
  51. const int possible_results[][commit_count], int results_count)
  52. {
  53. git_oid oid;
  54. int i;
  55. int result_array[commit_count];
  56. for (i = 0; i < commit_count; ++i)
  57. result_array[i] = -1;
  58. i = 0;
  59. while (git_revwalk_next(&oid, walk) == 0) {
  60. result_array[i++] = get_commit_index(&oid);
  61. /*{
  62. char str[GIT_OID_HEXSZ+1];
  63. git_oid_fmt(str, &oid);
  64. str[GIT_OID_HEXSZ] = 0;
  65. printf(" %d) %s\n", i, str);
  66. }*/
  67. }
  68. for (i = 0; i < results_count; ++i)
  69. if (memcmp(possible_results[i],
  70. result_array, result_bytes) == 0)
  71. return 0;
  72. return GIT_ERROR;
  73. }
  74. static int test_walk(git_revwalk *walk, const git_oid *root,
  75. int flags, const int possible_results[][6], int results_count)
  76. {
  77. git_revwalk_sorting(walk, flags);
  78. git_revwalk_push(walk, root);
  79. return test_walk_only(walk, possible_results, results_count);
  80. }
  81. static git_repository *_repo = NULL;
  82. static git_revwalk *_walk = NULL;
  83. static const char *_fixture = NULL;
  84. void test_revwalk_basic__initialize(void)
  85. {
  86. }
  87. void test_revwalk_basic__cleanup(void)
  88. {
  89. git_revwalk_free(_walk);
  90. if (_fixture)
  91. cl_git_sandbox_cleanup();
  92. else
  93. git_repository_free(_repo);
  94. _fixture = NULL;
  95. _repo = NULL;
  96. _walk = NULL;
  97. }
  98. static void revwalk_basic_setup_walk(const char *fixture)
  99. {
  100. if (fixture) {
  101. _fixture = fixture;
  102. _repo = cl_git_sandbox_init(fixture);
  103. } else {
  104. cl_git_pass(git_repository_open(&_repo, cl_fixture("testrepo.git")));
  105. }
  106. cl_git_pass(git_revwalk_new(&_walk, _repo));
  107. }
  108. void test_revwalk_basic__sorting_modes(void)
  109. {
  110. git_oid id;
  111. revwalk_basic_setup_walk(NULL);
  112. git_oid_fromstr(&id, commit_head);
  113. cl_git_pass(test_walk(_walk, &id, GIT_SORT_TIME, commit_sorting_time, 1));
  114. cl_git_pass(test_walk(_walk, &id, GIT_SORT_TOPOLOGICAL, commit_sorting_topo, 2));
  115. cl_git_pass(test_walk(_walk, &id, GIT_SORT_TIME | GIT_SORT_REVERSE, commit_sorting_time_reverse, 1));
  116. cl_git_pass(test_walk(_walk, &id, GIT_SORT_TOPOLOGICAL | GIT_SORT_REVERSE, commit_sorting_topo_reverse, 2));
  117. }
  118. void test_revwalk_basic__glob_heads(void)
  119. {
  120. int i = 0;
  121. git_oid oid;
  122. revwalk_basic_setup_walk(NULL);
  123. cl_git_pass(git_revwalk_push_glob(_walk, "heads"));
  124. while (git_revwalk_next(&oid, _walk) == 0)
  125. i++;
  126. /* git log --branches --oneline | wc -l => 14 */
  127. cl_assert_equal_i(i, 14);
  128. }
  129. void test_revwalk_basic__glob_heads_with_invalid(void)
  130. {
  131. int i;
  132. git_oid oid;
  133. revwalk_basic_setup_walk("testrepo");
  134. cl_git_mkfile("testrepo/.git/refs/heads/garbage", "not-a-ref");
  135. cl_git_pass(git_revwalk_push_glob(_walk, "heads"));
  136. for (i = 0; !git_revwalk_next(&oid, _walk); ++i)
  137. /* walking */;
  138. /* git log --branches --oneline | wc -l => 16 */
  139. cl_assert_equal_i(20, i);
  140. }
  141. void test_revwalk_basic__push_head(void)
  142. {
  143. int i = 0;
  144. git_oid oid;
  145. revwalk_basic_setup_walk(NULL);
  146. cl_git_pass(git_revwalk_push_head(_walk));
  147. while (git_revwalk_next(&oid, _walk) == 0) {
  148. i++;
  149. }
  150. /* git log HEAD --oneline | wc -l => 7 */
  151. cl_assert_equal_i(i, 7);
  152. }
  153. void test_revwalk_basic__sorted_after_reset(void)
  154. {
  155. int i = 0;
  156. git_oid oid;
  157. revwalk_basic_setup_walk(NULL);
  158. git_oid_fromstr(&oid, commit_head);
  159. /* push, sort, and test the walk */
  160. cl_git_pass(git_revwalk_push(_walk, &oid));
  161. git_revwalk_sorting(_walk, GIT_SORT_TIME);
  162. cl_git_pass(test_walk_only(_walk, commit_sorting_time, 2));
  163. /* reset, push, and test again - we should see all entries */
  164. git_revwalk_reset(_walk);
  165. cl_git_pass(git_revwalk_push(_walk, &oid));
  166. while (git_revwalk_next(&oid, _walk) == 0)
  167. i++;
  168. cl_assert_equal_i(i, commit_count);
  169. }
  170. void test_revwalk_basic__push_head_hide_ref(void)
  171. {
  172. int i = 0;
  173. git_oid oid;
  174. revwalk_basic_setup_walk(NULL);
  175. cl_git_pass(git_revwalk_push_head(_walk));
  176. cl_git_pass(git_revwalk_hide_ref(_walk, "refs/heads/packed-test"));
  177. while (git_revwalk_next(&oid, _walk) == 0) {
  178. i++;
  179. }
  180. /* git log HEAD --oneline --not refs/heads/packed-test | wc -l => 4 */
  181. cl_assert_equal_i(i, 4);
  182. }
  183. void test_revwalk_basic__push_head_hide_ref_nobase(void)
  184. {
  185. int i = 0;
  186. git_oid oid;
  187. revwalk_basic_setup_walk(NULL);
  188. cl_git_pass(git_revwalk_push_head(_walk));
  189. cl_git_pass(git_revwalk_hide_ref(_walk, "refs/heads/packed"));
  190. while (git_revwalk_next(&oid, _walk) == 0) {
  191. i++;
  192. }
  193. /* git log HEAD --oneline --not refs/heads/packed | wc -l => 7 */
  194. cl_assert_equal_i(i, 7);
  195. }
  196. /*
  197. * $ git rev-list HEAD 5b5b02 ^refs/heads/packed-test
  198. * a65fedf39aefe402d3bb6e24df4d4f5fe4547750
  199. * be3563ae3f795b2b4353bcce3a527ad0a4f7f644
  200. * c47800c7266a2be04c571c04d5a6614691ea99bd
  201. * 9fd738e8f7967c078dceed8190330fc8648ee56a
  202. * $ git log HEAD 5b5b02 --oneline --not refs/heads/packed-test | wc -l => 4
  203. * a65fedf
  204. * be3563a Merge branch 'br2'
  205. * c47800c branch commit one
  206. * 9fd738e a fourth commit
  207. */
  208. void test_revwalk_basic__multiple_push_1(void)
  209. {
  210. int i = 0;
  211. git_oid oid;
  212. revwalk_basic_setup_walk(NULL);
  213. cl_git_pass(git_revwalk_push_head(_walk));
  214. cl_git_pass(git_revwalk_hide_ref(_walk, "refs/heads/packed-test"));
  215. cl_git_pass(git_oid_fromstr(&oid, "5b5b025afb0b4c913b4c338a42934a3863bf3644"));
  216. cl_git_pass(git_revwalk_push(_walk, &oid));
  217. while (git_revwalk_next(&oid, _walk) == 0)
  218. i++;
  219. cl_assert_equal_i(i, 4);
  220. }
  221. /*
  222. * Difference between test_revwalk_basic__multiple_push_1 and
  223. * test_revwalk_basic__multiple_push_2 is in the order reference
  224. * refs/heads/packed-test and commit 5b5b02 are pushed.
  225. * revwalk should return same commits in both the tests.
  226. * $ git rev-list 5b5b02 HEAD ^refs/heads/packed-test
  227. * a65fedf39aefe402d3bb6e24df4d4f5fe4547750
  228. * be3563ae3f795b2b4353bcce3a527ad0a4f7f644
  229. * c47800c7266a2be04c571c04d5a6614691ea99bd
  230. * 9fd738e8f7967c078dceed8190330fc8648ee56a
  231. * $ git log 5b5b02 HEAD --oneline --not refs/heads/packed-test | wc -l => 4
  232. * a65fedf
  233. * be3563a Merge branch 'br2'
  234. * c47800c branch commit one
  235. * 9fd738e a fourth commit
  236. */
  237. void test_revwalk_basic__multiple_push_2(void)
  238. {
  239. int i = 0;
  240. git_oid oid;
  241. revwalk_basic_setup_walk(NULL);
  242. cl_git_pass(git_oid_fromstr(&oid, "5b5b025afb0b4c913b4c338a42934a3863bf3644"));
  243. cl_git_pass(git_revwalk_push(_walk, &oid));
  244. cl_git_pass(git_revwalk_hide_ref(_walk, "refs/heads/packed-test"));
  245. cl_git_pass(git_revwalk_push_head(_walk));
  246. while (git_revwalk_next(&oid, _walk) == 0)
  247. i++;
  248. cl_assert_equal_i(i, 4);
  249. }
  250. void test_revwalk_basic__disallow_non_commit(void)
  251. {
  252. git_oid oid;
  253. revwalk_basic_setup_walk(NULL);
  254. cl_git_pass(git_oid_fromstr(&oid, "521d87c1ec3aef9824daf6d96cc0ae3710766d91"));
  255. cl_git_fail(git_revwalk_push(_walk, &oid));
  256. }
  257. void test_revwalk_basic__hide_then_push(void)
  258. {
  259. git_oid oid;
  260. int i = 0;
  261. revwalk_basic_setup_walk(NULL);
  262. cl_git_pass(git_oid_fromstr(&oid, "5b5b025afb0b4c913b4c338a42934a3863bf3644"));
  263. cl_git_pass(git_revwalk_hide(_walk, &oid));
  264. cl_git_pass(git_revwalk_push(_walk, &oid));
  265. while (git_revwalk_next(&oid, _walk) == 0)
  266. i++;
  267. cl_assert_equal_i(i, 0);
  268. }
  269. void test_revwalk_basic__topo_crash(void)
  270. {
  271. git_oid oid;
  272. git_oid_fromstr(&oid, "5b5b025afb0b4c913b4c338a42934a3863bf3644");
  273. revwalk_basic_setup_walk(NULL);
  274. git_revwalk_sorting(_walk, GIT_SORT_TOPOLOGICAL);
  275. cl_git_pass(git_revwalk_push(_walk, &oid));
  276. cl_git_pass(git_revwalk_hide(_walk, &oid));
  277. git_revwalk_next(&oid, _walk);
  278. }
  279. void test_revwalk_basic__from_new_to_old(void)
  280. {
  281. git_oid from_oid, to_oid, oid;
  282. int i = 0;
  283. revwalk_basic_setup_walk(NULL);
  284. git_revwalk_sorting(_walk, GIT_SORT_TIME);
  285. cl_git_pass(git_oid_fromstr(&to_oid, "5b5b025afb0b4c913b4c338a42934a3863bf3644"));
  286. cl_git_pass(git_oid_fromstr(&from_oid, "a4a7dce85cf63874e984719f4fdd239f5145052f"));
  287. cl_git_pass(git_revwalk_push(_walk, &to_oid));
  288. cl_git_pass(git_revwalk_hide(_walk, &from_oid));
  289. while (git_revwalk_next(&oid, _walk) == 0)
  290. i++;
  291. cl_assert_equal_i(i, 0);
  292. }
  293. void test_revwalk_basic__push_range(void)
  294. {
  295. revwalk_basic_setup_walk(NULL);
  296. git_revwalk_reset(_walk);
  297. git_revwalk_sorting(_walk, 0);
  298. cl_git_pass(git_revwalk_push_range(_walk, "9fd738e~2..9fd738e"));
  299. cl_git_pass(test_walk_only(_walk, commit_sorting_segment, 2));
  300. }
  301. void test_revwalk_basic__push_range_merge_base(void)
  302. {
  303. revwalk_basic_setup_walk(NULL);
  304. git_revwalk_reset(_walk);
  305. git_revwalk_sorting(_walk, 0);
  306. cl_git_fail_with(GIT_EINVALIDSPEC, git_revwalk_push_range(_walk, "HEAD...HEAD~2"));
  307. }
  308. void test_revwalk_basic__push_range_no_range(void)
  309. {
  310. revwalk_basic_setup_walk(NULL);
  311. git_revwalk_reset(_walk);
  312. git_revwalk_sorting(_walk, 0);
  313. cl_git_fail_with(GIT_EINVALIDSPEC, git_revwalk_push_range(_walk, "HEAD"));
  314. }
  315. void test_revwalk_basic__push_mixed(void)
  316. {
  317. git_oid oid;
  318. int i = 0;
  319. revwalk_basic_setup_walk(NULL);
  320. git_revwalk_reset(_walk);
  321. git_revwalk_sorting(_walk, 0);
  322. cl_git_pass(git_revwalk_push_glob(_walk, "tags"));
  323. while (git_revwalk_next(&oid, _walk) == 0) {
  324. i++;
  325. }
  326. /* git rev-list --count --glob=tags #=> 9 */
  327. cl_assert_equal_i(9, i);
  328. }
  329. void test_revwalk_basic__push_all(void)
  330. {
  331. git_oid oid;
  332. int i = 0;
  333. revwalk_basic_setup_walk(NULL);
  334. git_revwalk_reset(_walk);
  335. git_revwalk_sorting(_walk, 0);
  336. cl_git_pass(git_revwalk_push_glob(_walk, "*"));
  337. while (git_revwalk_next(&oid, _walk) == 0) {
  338. i++;
  339. }
  340. /* git rev-list --count --all #=> 15 */
  341. cl_assert_equal_i(15, i);
  342. }
  343. /*
  344. * $ git rev-list br2 master e908
  345. * a65fedf39aefe402d3bb6e24df4d4f5fe4547750
  346. * e90810b8df3e80c413d903f631643c716887138d
  347. * 6dcf9bf7541ee10456529833502442f385010c3d
  348. * a4a7dce85cf63874e984719f4fdd239f5145052f
  349. * be3563ae3f795b2b4353bcce3a527ad0a4f7f644
  350. * c47800c7266a2be04c571c04d5a6614691ea99bd
  351. * 9fd738e8f7967c078dceed8190330fc8648ee56a
  352. * 4a202b346bb0fb0db7eff3cffeb3c70babbd2045
  353. * 5b5b025afb0b4c913b4c338a42934a3863bf3644
  354. * 8496071c1b46c854b31185ea97743be6a8774479
  355. */
  356. void test_revwalk_basic__mimic_git_rev_list(void)
  357. {
  358. git_oid oid;
  359. revwalk_basic_setup_walk(NULL);
  360. git_revwalk_sorting(_walk, GIT_SORT_TIME);
  361. cl_git_pass(git_revwalk_push_ref(_walk, "refs/heads/br2"));
  362. cl_git_pass(git_revwalk_push_ref(_walk, "refs/heads/master"));
  363. cl_git_pass(git_oid_fromstr(&oid, "e90810b8df3e80c413d903f631643c716887138d"));
  364. cl_git_pass(git_revwalk_push(_walk, &oid));
  365. cl_git_pass(git_revwalk_next(&oid, _walk));
  366. cl_assert(!git_oid_streq(&oid, "a65fedf39aefe402d3bb6e24df4d4f5fe4547750"));
  367. cl_git_pass(git_revwalk_next(&oid, _walk));
  368. cl_assert(!git_oid_streq(&oid, "e90810b8df3e80c413d903f631643c716887138d"));
  369. cl_git_pass(git_revwalk_next(&oid, _walk));
  370. cl_assert(!git_oid_streq(&oid, "6dcf9bf7541ee10456529833502442f385010c3d"));
  371. cl_git_pass(git_revwalk_next(&oid, _walk));
  372. cl_assert(!git_oid_streq(&oid, "a4a7dce85cf63874e984719f4fdd239f5145052f"));
  373. cl_git_pass(git_revwalk_next(&oid, _walk));
  374. cl_assert(!git_oid_streq(&oid, "be3563ae3f795b2b4353bcce3a527ad0a4f7f644"));
  375. cl_git_pass(git_revwalk_next(&oid, _walk));
  376. cl_assert(!git_oid_streq(&oid, "c47800c7266a2be04c571c04d5a6614691ea99bd"));
  377. cl_git_pass(git_revwalk_next(&oid, _walk));
  378. cl_assert(!git_oid_streq(&oid, "9fd738e8f7967c078dceed8190330fc8648ee56a"));
  379. cl_git_pass(git_revwalk_next(&oid, _walk));
  380. cl_assert(!git_oid_streq(&oid, "4a202b346bb0fb0db7eff3cffeb3c70babbd2045"));
  381. cl_git_pass(git_revwalk_next(&oid, _walk));
  382. cl_assert(!git_oid_streq(&oid, "5b5b025afb0b4c913b4c338a42934a3863bf3644"));
  383. cl_git_pass(git_revwalk_next(&oid, _walk));
  384. cl_assert(!git_oid_streq(&oid, "8496071c1b46c854b31185ea97743be6a8774479"));
  385. cl_git_fail_with(git_revwalk_next(&oid, _walk), GIT_ITEROVER);
  386. }
  387. void test_revwalk_basic__big_timestamp(void)
  388. {
  389. git_reference *head;
  390. git_commit *tip;
  391. git_signature *sig;
  392. git_tree *tree;
  393. git_oid id;
  394. int error;
  395. revwalk_basic_setup_walk("testrepo.git");
  396. cl_git_pass(git_repository_head(&head, _repo));
  397. cl_git_pass(git_reference_peel((git_object **) &tip, head, GIT_OBJECT_COMMIT));
  398. /* Commit with a far-ahead timestamp, we should be able to parse it in the revwalk */
  399. cl_git_pass(git_signature_new(&sig, "Joe", "joe@example.com", 2399662595ll, 0));
  400. cl_git_pass(git_commit_tree(&tree, tip));
  401. cl_git_pass(git_commit_create(&id, _repo, "HEAD", sig, sig, NULL, "some message", tree, 1,
  402. (const git_commit **)&tip));
  403. cl_git_pass(git_revwalk_push_head(_walk));
  404. while ((error = git_revwalk_next(&id, _walk)) == 0) {
  405. /* nothing */
  406. }
  407. cl_assert_equal_i(GIT_ITEROVER, error);
  408. git_tree_free(tree);
  409. git_commit_free(tip);
  410. git_reference_free(head);
  411. git_signature_free(sig);
  412. }
  413. /* Ensure that we correctly hide a commit that is (timewise) older
  414. * than the commits that we are showing.
  415. *
  416. * % git rev-list 8e73b76..bd75801
  417. * bd758010071961f28336333bc41e9c64c9a64866
  418. */
  419. void test_revwalk_basic__old_hidden_commit_one(void)
  420. {
  421. git_oid new_id, old_id, oid;
  422. revwalk_basic_setup_walk("testrepo.git");
  423. cl_git_pass(git_oid_fromstr(&new_id, "bd758010071961f28336333bc41e9c64c9a64866"));
  424. cl_git_pass(git_revwalk_push(_walk, &new_id));
  425. cl_git_pass(git_oid_fromstr(&old_id, "8e73b769e97678d684b809b163bebdae2911720f"));
  426. cl_git_pass(git_revwalk_hide(_walk, &old_id));
  427. cl_git_pass(git_revwalk_next(&oid, _walk));
  428. cl_assert(!git_oid_streq(&oid, "bd758010071961f28336333bc41e9c64c9a64866"));
  429. cl_git_fail_with(GIT_ITEROVER, git_revwalk_next(&oid, _walk));
  430. }
  431. /* Ensure that we correctly hide a commit that is (timewise) older
  432. * than the commits that we are showing.
  433. *
  434. * % git rev-list bd75801 ^b91e763
  435. * bd758010071961f28336333bc41e9c64c9a64866
  436. */
  437. void test_revwalk_basic__old_hidden_commit_two(void)
  438. {
  439. git_oid new_id, old_id, oid;
  440. revwalk_basic_setup_walk("testrepo.git");
  441. cl_git_pass(git_oid_fromstr(&new_id, "bd758010071961f28336333bc41e9c64c9a64866"));
  442. cl_git_pass(git_revwalk_push(_walk, &new_id));
  443. cl_git_pass(git_oid_fromstr(&old_id, "b91e763008b10db366442469339f90a2b8400d0a"));
  444. cl_git_pass(git_revwalk_hide(_walk, &old_id));
  445. cl_git_pass(git_revwalk_next(&oid, _walk));
  446. cl_assert(!git_oid_streq(&oid, "bd758010071961f28336333bc41e9c64c9a64866"));
  447. cl_git_fail_with(GIT_ITEROVER, git_revwalk_next(&oid, _walk));
  448. }
  449. /*
  450. * Ensure that we correctly hide all parent commits of a newer
  451. * commit when first hiding older commits.
  452. *
  453. * % git rev-list D ^B ^A ^E
  454. * 790ba0facf6fd103699a5c40cd19dad277ff49cd
  455. * b82cee5004151ae0c4f82b69fb71b87477664b6f
  456. */
  457. void test_revwalk_basic__newer_hidden_commit_hides_old_commits(void)
  458. {
  459. git_oid oid;
  460. revwalk_basic_setup_walk("revwalk.git");
  461. cl_git_pass(git_revwalk_push_ref(_walk, "refs/heads/D"));
  462. cl_git_pass(git_revwalk_hide_ref(_walk, "refs/heads/B"));
  463. cl_git_pass(git_revwalk_hide_ref(_walk, "refs/heads/A"));
  464. cl_git_pass(git_revwalk_hide_ref(_walk, "refs/heads/E"));
  465. cl_git_pass(git_revwalk_next(&oid, _walk));
  466. cl_assert(git_oid_streq(&oid, "b82cee5004151ae0c4f82b69fb71b87477664b6f"));
  467. cl_git_pass(git_revwalk_next(&oid, _walk));
  468. cl_assert(git_oid_streq(&oid, "790ba0facf6fd103699a5c40cd19dad277ff49cd"));
  469. cl_git_fail_with(GIT_ITEROVER, git_revwalk_next(&oid, _walk));
  470. }