forked from libgit2/php-git
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy path008-02-walker_itrate.phpt
More file actions
49 lines (37 loc) · 1.15 KB
/
008-02-walker_itrate.phpt
File metadata and controls
49 lines (37 loc) · 1.15 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
--TEST--
Check for Git2\Walker::construct
--SKIPIF--
<?php if (!extension_loaded("git2")) print "skip"; ?>
--FILE--
<?php
$path = __DIR__ . '/mock/008-02';
$repo = new Git2\Repository($path);
$walker = new Git2\Walker($repo);
$walker->push("6e20138dc38f9f626107f1cd3ef0f9838c43defe");
foreach ($walker as $oid => $commit) {
printf("oid: %s\n", $oid);
printf("message: %s\n", $commit->getMessage());
}
echo "==== rewind ====\n\n";
foreach ($walker as $oid => $commit) {
printf("oid: %s\n", $oid);
printf("message: %s\n", $commit->getMessage());
}
--EXPECT--
oid: 6e20138dc38f9f626107f1cd3ef0f9838c43defe
message: added section 1 contents
oid: 9bb8c853c9ea27609a6bdc48b78cd26a320daf7d
message: added section 1
oid: 7fce1026cb624448e5a8cf8752bd5e19d8f2cb1f
message: modified README
oid: ffc6c773865c1342db9cd5df5777fc91ddeb8a4d
message: initial commit
==== rewind ====
oid: 6e20138dc38f9f626107f1cd3ef0f9838c43defe
message: added section 1 contents
oid: 9bb8c853c9ea27609a6bdc48b78cd26a320daf7d
message: added section 1
oid: 7fce1026cb624448e5a8cf8752bd5e19d8f2cb1f
message: modified README
oid: ffc6c773865c1342db9cd5df5777fc91ddeb8a4d
message: initial commit