@dotinc/ogre 0.7.0 → 0.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.tap/processinfo/{21e0110c-397c-4c38-a84a-89c55de41e7e.json → 12fba5c1-f3d6-4b95-865b-9251ded2f6e3.json} +7 -6
- package/.tap/processinfo/{51b87298-fd44-42a9-b0f8-d4533e58fd1c.json → 38a3e28a-f045-4a32-bfc3-ca756e9457eb.json} +35 -34
- package/.tap/processinfo/{d1b618cb-a921-4f1c-ae4a-6bca359b5909.json → 594c45a4-6863-423e-9759-b092527c8ac4.json} +23 -22
- package/.tap/processinfo/{36da4059-ca5e-4b70-a993-7f99f94f7588.json → 671766c2-87ab-40cf-8051-2b74d41d0bc5.json} +7 -6
- package/.tap/processinfo/{75459f57-2341-476b-8576-587b93699d8b.json → a2952f0b-bb22-4fd6-a729-f9c500431030.json} +7 -6
- package/.tap/processinfo/{4aa37d99-4038-4033-9d38-beea00272892.json → cfca41ce-a29e-4cef-9564-b1f52749806b.json} +7 -6
- package/.tap/processinfo/{9656a0a0-72ab-4ea7-abb7-7415cd3842b4.json → d116ec0f-f197-434d-8a14-1f09a4b274ea.json} +23 -22
- package/.tap/test-results/src/branch.test.ts.tap +6 -6
- package/.tap/test-results/src/checkout.test.ts.tap +9 -9
- package/.tap/test-results/src/commit.test.ts.tap +18 -18
- package/.tap/test-results/src/merge.test.ts.tap +2 -2
- package/.tap/test-results/src/repository.test.ts.tap +23 -23
- package/.tap/test-results/src/tag.test.ts.tap +3 -3
- package/.tap/test-results/src/utils.test.ts.tap +7 -7
- package/CHANGELOG.md +13 -0
- package/lib/git2json.js +3 -4
- package/lib/repository.d.ts +1 -18
- package/lib/repository.js +39 -196
- package/lib/utils.d.ts +55 -0
- package/lib/utils.js +183 -2
- package/package.json +2 -2
- package/src/commit.test.ts +2 -1
- package/src/git2json.ts +6 -2
- package/src/repository.test.ts +2 -1
- package/src/repository.ts +28 -195
- package/src/utils.ts +194 -0
|
@@ -4,19 +4,19 @@ TAP version 14
|
|
|
4
4
|
ok 2 - incorrect \# of commits
|
|
5
5
|
ok 3 - points to wrong commit
|
|
6
6
|
ok 4 - repo is not in detached state
|
|
7
|
-
ok 5 - has a nested object when it shouldn't: {"uuid":"
|
|
7
|
+
ok 5 - has a nested object when it shouldn't: {"uuid":"468adbe2-06cc-40aa-bd5d-a21042630c88","name":"my first process template","description":"now we have a description","nested":[]}
|
|
8
8
|
1..5
|
|
9
|
-
ok 1 - checkout prev commit # time=
|
|
9
|
+
ok 1 - checkout prev commit # time=109.073ms
|
|
10
10
|
|
|
11
11
|
# Subtest: checkout new branch with simple name
|
|
12
12
|
ok 1 - HEAD is not moved to target branch
|
|
13
13
|
1..1
|
|
14
|
-
ok 2 - checkout new branch with simple name # time=
|
|
14
|
+
ok 2 - checkout new branch with simple name # time=3.238ms
|
|
15
15
|
|
|
16
16
|
# Subtest: checkout new branch with full ref name
|
|
17
17
|
ok 1 - HEAD is not moved to target branch
|
|
18
18
|
1..1
|
|
19
|
-
ok 3 - checkout new branch with full ref name # time=2.
|
|
19
|
+
ok 3 - checkout new branch with full ref name # time=2.418ms
|
|
20
20
|
|
|
21
21
|
# Subtest: checkout commit which has two refs pointing leaves HEAD detached
|
|
22
22
|
ok 1 - main does not point to commit
|
|
@@ -24,29 +24,29 @@ ok 3 - checkout new branch with full ref name # time=2.381ms
|
|
|
24
24
|
ok 3 - HEAD is not detached at commit
|
|
25
25
|
ok 4 - HEAD is not pointing to commit
|
|
26
26
|
1..4
|
|
27
|
-
ok 4 - checkout commit which has two refs pointing leaves HEAD detached # time=2.
|
|
27
|
+
ok 4 - checkout commit which has two refs pointing leaves HEAD detached # time=2.813ms
|
|
28
28
|
|
|
29
29
|
# Subtest: checkout new branch moves head to new branch
|
|
30
30
|
ok 1 - HEAD is not moved to target branch
|
|
31
31
|
1..1
|
|
32
|
-
ok 5 - checkout new branch moves head to new branch # time=2.
|
|
32
|
+
ok 5 - checkout new branch moves head to new branch # time=2.408ms
|
|
33
33
|
|
|
34
34
|
# Subtest: checkout and create new branch on empty main
|
|
35
35
|
ok 1 - HEAD should point to empty branch
|
|
36
36
|
ok 2 - branch still should be empty
|
|
37
37
|
1..2
|
|
38
|
-
ok 6 - checkout and create new branch on empty main # time=0.
|
|
38
|
+
ok 6 - checkout and create new branch on empty main # time=0.719ms
|
|
39
39
|
|
|
40
40
|
# Subtest: checkout and create new branch with at least 1 commit
|
|
41
41
|
ok 1 - HEAD should point to new branch
|
|
42
42
|
ok 2 - branch is not pointing to last HEAD commit
|
|
43
43
|
1..2
|
|
44
|
-
ok 7 - checkout and create new branch with at least 1 commit # time=
|
|
44
|
+
ok 7 - checkout and create new branch with at least 1 commit # time=2.355ms
|
|
45
45
|
|
|
46
46
|
# Subtest: replacing default branch on empty master removes main
|
|
47
47
|
ok 1 - new branch w/ incorrect \# of changelog entries
|
|
48
48
|
ok 2 - expected to throw
|
|
49
49
|
1..2
|
|
50
|
-
ok 8 - replacing default branch on empty master removes main # time=
|
|
50
|
+
ok 8 - replacing default branch on empty master removes main # time=14.352ms
|
|
51
51
|
|
|
52
52
|
1..8
|
|
@@ -3,58 +3,58 @@ TAP version 14
|
|
|
3
3
|
ok 1 - has changelog entries
|
|
4
4
|
ok 2 - incorrect \# of commits
|
|
5
5
|
1..2
|
|
6
|
-
ok 1 - baseline with 1 commit and zero changelog entries # time=
|
|
6
|
+
ok 1 - baseline with 1 commit and zero changelog entries # time=310.08ms
|
|
7
7
|
|
|
8
8
|
# Subtest: head points to main
|
|
9
9
|
ok 1 - head not pointing where it should
|
|
10
10
|
1..1
|
|
11
|
-
ok 2 - head points to main # time=
|
|
11
|
+
ok 2 - head points to main # time=0.969ms
|
|
12
12
|
|
|
13
13
|
# Subtest: changes are available for commit if starting from empty
|
|
14
14
|
ok 1 - Status does not contain the right amount of changes
|
|
15
15
|
ok 2 - (unnamed test)
|
|
16
16
|
1..2
|
|
17
|
-
ok 3 - changes are available for commit if starting from empty # time=
|
|
17
|
+
ok 3 - changes are available for commit if starting from empty # time=12.618ms
|
|
18
18
|
|
|
19
19
|
# Subtest: no commit without changes
|
|
20
20
|
ok 1 - expected to reject
|
|
21
21
|
1..1
|
|
22
|
-
ok 4 - no commit without changes # time=
|
|
22
|
+
ok 4 - no commit without changes # time=19.287ms
|
|
23
23
|
|
|
24
24
|
# Subtest: no commit without changes after recent commit
|
|
25
25
|
ok 1 - expected to reject
|
|
26
26
|
1..1
|
|
27
|
-
ok 5 - no commit without changes after recent commit # time=
|
|
27
|
+
ok 5 - no commit without changes after recent commit # time=4.051ms
|
|
28
28
|
|
|
29
29
|
# Subtest: overwrite nested array changes are recognized
|
|
30
30
|
1..0
|
|
31
|
-
ok 6 - overwrite nested array changes are recognized # time=
|
|
31
|
+
ok 6 - overwrite nested array changes are recognized # time=4.302ms
|
|
32
32
|
|
|
33
33
|
# Subtest: change of nested array element is recognized
|
|
34
34
|
1..0
|
|
35
|
-
ok 7 - change of nested array element is recognized # time=
|
|
35
|
+
ok 7 - change of nested array element is recognized # time=17.639ms
|
|
36
36
|
|
|
37
37
|
# Subtest: treeHash of commit is matching content
|
|
38
38
|
ok 1 - should be equal
|
|
39
39
|
ok 2 - tree hash mismatch
|
|
40
40
|
1..2
|
|
41
|
-
ok 8 - treeHash of commit is matching content # time=
|
|
41
|
+
ok 8 - treeHash of commit is matching content # time=3.081ms
|
|
42
42
|
|
|
43
43
|
# Subtest: no commit --amend without commit
|
|
44
44
|
ok 1 - expected to reject
|
|
45
45
|
1..1
|
|
46
|
-
ok 9 - no commit --amend without commit # time=2.
|
|
46
|
+
ok 9 - no commit --amend without commit # time=2.163ms
|
|
47
47
|
|
|
48
48
|
# Subtest: main moves to recent commit
|
|
49
49
|
ok 1 - head does not point to recent commit
|
|
50
50
|
1..1
|
|
51
|
-
ok 10 - main moves to recent commit # time=
|
|
51
|
+
ok 10 - main moves to recent commit # time=1.891ms
|
|
52
52
|
|
|
53
53
|
# Subtest: two commits with 3 changes
|
|
54
54
|
ok 1 - incorrect \# of changelog entries
|
|
55
55
|
ok 2 - incorrect \# of commits
|
|
56
56
|
1..2
|
|
57
|
-
ok 11 - two commits with 3 changes # time=
|
|
57
|
+
ok 11 - two commits with 3 changes # time=14.949ms
|
|
58
58
|
|
|
59
59
|
# Subtest: array push double-change, 6 changes, 3 commits
|
|
60
60
|
ok 1 - incorrect \# of changelog entries
|
|
@@ -62,7 +62,7 @@ ok 11 - two commits with 3 changes # time=2.852ms
|
|
|
62
62
|
ok 3 - \#incorrect \# of changes in commit\#1
|
|
63
63
|
ok 4 - \#incorrect \# of changes in commit\#2
|
|
64
64
|
1..4
|
|
65
|
-
ok 12 - array push double-change, 6 changes, 3 commits # time=
|
|
65
|
+
ok 12 - array push double-change, 6 changes, 3 commits # time=5.731ms
|
|
66
66
|
|
|
67
67
|
# Subtest: all refs OK, when committing on new branch while main is empty main
|
|
68
68
|
ok 1 - main should not point to a commit
|
|
@@ -70,7 +70,7 @@ ok 12 - array push double-change, 6 changes, 3 commits # time=9.258ms
|
|
|
70
70
|
ok 3 - branch should now be visible
|
|
71
71
|
ok 4 - HEAD is pointing to wrong branch
|
|
72
72
|
1..4
|
|
73
|
-
ok 13 - all refs OK, when committing on new branch while main is empty main # time=
|
|
73
|
+
ok 13 - all refs OK, when committing on new branch while main is empty main # time=3.891ms
|
|
74
74
|
|
|
75
75
|
# Subtest: commit --amend changes hash on content change
|
|
76
76
|
ok 1 - hash should have changed
|
|
@@ -80,7 +80,7 @@ ok 13 - all refs OK, when committing on new branch while main is empty main # ti
|
|
|
80
80
|
ok 5 - we are on the wrong branch
|
|
81
81
|
ok 6 - main should point to changed commit hash
|
|
82
82
|
1..6
|
|
83
|
-
ok 14 - commit --amend changes hash on content change # time=
|
|
83
|
+
ok 14 - commit --amend changes hash on content change # time=41.767ms
|
|
84
84
|
|
|
85
85
|
# Subtest: commit --amend changes hash on message change
|
|
86
86
|
ok 1 - hash should have changed
|
|
@@ -90,7 +90,7 @@ ok 14 - commit --amend changes hash on content change # time=17.168ms
|
|
|
90
90
|
ok 5 - we are on the wrong branch
|
|
91
91
|
ok 6 - main should point to changed commit hash
|
|
92
92
|
1..6
|
|
93
|
-
ok 15 - commit --amend changes hash on message change # time=
|
|
93
|
+
ok 15 - commit --amend changes hash on message change # time=20.981ms
|
|
94
94
|
|
|
95
95
|
# Subtest: commit at detached HEAD does not affect main, but moves head
|
|
96
96
|
ok 1 - HEAD did not move to commit
|
|
@@ -99,12 +99,12 @@ ok 15 - commit --amend changes hash on message change # time=3.43ms
|
|
|
99
99
|
ok 4 - HEAD did not move to commit
|
|
100
100
|
ok 5 - main branch did not stay at last commit
|
|
101
101
|
1..5
|
|
102
|
-
ok 16 - commit at detached HEAD does not affect main, but moves head # time=
|
|
102
|
+
ok 16 - commit at detached HEAD does not affect main, but moves head # time=29.839ms
|
|
103
103
|
|
|
104
104
|
# Subtest: commit at detached HEAD saved to a branch
|
|
105
105
|
ok 1 - savepoint branch should point to last detached commit
|
|
106
106
|
1..1
|
|
107
|
-
ok 17 - commit at detached HEAD saved to a branch # time=
|
|
107
|
+
ok 17 - commit at detached HEAD saved to a branch # time=3.199ms
|
|
108
108
|
|
|
109
109
|
# Subtest: commit --amend changes hash on message change even in detached HEAD
|
|
110
110
|
ok 1 - hash should have changed
|
|
@@ -114,6 +114,6 @@ ok 17 - commit at detached HEAD saved to a branch # time=2.548ms
|
|
|
114
114
|
ok 5 - HEAD is not pointing to detached commit
|
|
115
115
|
ok 6 - main should point to changed commit hash
|
|
116
116
|
1..6
|
|
117
|
-
ok 18 - commit --amend changes hash on message change even in detached HEAD # time=14.
|
|
117
|
+
ok 18 - commit --amend changes hash on message change even in detached HEAD # time=14.841ms
|
|
118
118
|
|
|
119
119
|
1..18
|
|
@@ -2,7 +2,7 @@ TAP version 14
|
|
|
2
2
|
# Subtest: merge with no commit fails
|
|
3
3
|
ok 1 - expected to throw
|
|
4
4
|
1..1
|
|
5
|
-
ok 1 - merge with no commit fails # time=
|
|
5
|
+
ok 1 - merge with no commit fails # time=23.359ms
|
|
6
6
|
|
|
7
7
|
# Subtest: merge fast-forward
|
|
8
8
|
ok 1 - HEAD not pointing to new_branch
|
|
@@ -11,6 +11,6 @@ ok 1 - merge with no commit fails # time=37.307ms
|
|
|
11
11
|
ok 4 - master is not at expected commit
|
|
12
12
|
ok 5 - fast-forward failed, superfluous commit detected
|
|
13
13
|
1..5
|
|
14
|
-
ok 2 - merge fast-forward # time=
|
|
14
|
+
ok 2 - merge fast-forward # time=8.655ms
|
|
15
15
|
|
|
16
16
|
1..2
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
TAP version 14
|
|
2
2
|
# Subtest: diff is ok
|
|
3
3
|
ok 1 - main is pointing at wrong commit
|
|
4
|
-
ok 2 - invalid \# of change entries: [{"op":"add","path":"/nested/0","value":{"uuid":"
|
|
4
|
+
ok 2 - invalid \# of change entries: [{"op":"add","path":"/nested/0","value":{"uuid":"d7c4a756-6ce4-41a2-8bac-298267bce00f","name":"new name"}},{"op":"add","path":"/nested/1","value":{"uuid":"fbf2e9a6-d72a-445b-878e-f1cde3a8bd11","name":"first name"}}]
|
|
5
5
|
1..2
|
|
6
|
-
ok 1 - diff is ok # time=
|
|
6
|
+
ok 1 - diff is ok # time=58.541ms
|
|
7
7
|
|
|
8
8
|
# Subtest: restore
|
|
9
9
|
# Subtest: history check
|
|
@@ -13,7 +13,7 @@ ok 1 - diff is ok # time=73.047ms
|
|
|
13
13
|
ok 4 - incorrect \# of commits
|
|
14
14
|
ok 5 - incorrect \# of changelog entries
|
|
15
15
|
1..5
|
|
16
|
-
ok 1 - history check # time=83.
|
|
16
|
+
ok 1 - history check # time=83.156ms
|
|
17
17
|
|
|
18
18
|
# Subtest: reconstruct with 2 commits
|
|
19
19
|
ok 1 - main is pointing at wrong commit
|
|
@@ -22,10 +22,10 @@ ok 1 - diff is ok # time=73.047ms
|
|
|
22
22
|
ok 4 - incorrect \# of commits
|
|
23
23
|
ok 5 - incorrect \# of changelog entries
|
|
24
24
|
1..5
|
|
25
|
-
ok 2 - reconstruct with 2 commits # time=
|
|
25
|
+
ok 2 - reconstruct with 2 commits # time=5.333ms
|
|
26
26
|
|
|
27
27
|
1..2
|
|
28
|
-
ok 2 - restore # time=
|
|
28
|
+
ok 2 - restore # time=132.936ms
|
|
29
29
|
|
|
30
30
|
# Subtest: history
|
|
31
31
|
# Subtest: history contains HEAD ref
|
|
@@ -34,15 +34,15 @@ ok 2 - restore # time=135.274ms
|
|
|
34
34
|
ok 3 - should be equal
|
|
35
35
|
ok 4 - should be equal
|
|
36
36
|
1..4
|
|
37
|
-
ok 1 - history contains HEAD ref # time=
|
|
37
|
+
ok 1 - history contains HEAD ref # time=54.656ms
|
|
38
38
|
|
|
39
39
|
# Subtest: empty history unreachable HEAD
|
|
40
40
|
ok 1 - expected to throw
|
|
41
41
|
1..1
|
|
42
|
-
ok 2 - empty history unreachable HEAD # time=2.
|
|
42
|
+
ok 2 - empty history unreachable HEAD # time=2.576ms
|
|
43
43
|
|
|
44
44
|
1..2
|
|
45
|
-
ok 3 - history # time=
|
|
45
|
+
ok 3 - history # time=112.596ms
|
|
46
46
|
|
|
47
47
|
# Subtest: reset
|
|
48
48
|
# Subtest: reset hard
|
|
@@ -50,54 +50,54 @@ ok 3 - history # time=181.711ms
|
|
|
50
50
|
ok 2 - wrong \# of changes in diff
|
|
51
51
|
ok 3 - failed to reset
|
|
52
52
|
1..3
|
|
53
|
-
ok 1 - reset hard # time=2.
|
|
53
|
+
ok 1 - reset hard # time=2.3ms
|
|
54
54
|
|
|
55
55
|
1..1
|
|
56
|
-
ok 4 - reset # time=
|
|
56
|
+
ok 4 - reset # time=56.424ms
|
|
57
57
|
|
|
58
58
|
# Subtest: status
|
|
59
59
|
# Subtest: clean repo no change
|
|
60
60
|
ok 1 - Shouldn't have pending changes
|
|
61
61
|
1..1
|
|
62
|
-
ok 1 - clean repo no change # time=
|
|
62
|
+
ok 1 - clean repo no change # time=395.567ms
|
|
63
63
|
|
|
64
64
|
# Subtest: clean repo pending change
|
|
65
65
|
ok 1 - Status doesn't contain the expected \# of changes: [{"op":"replace","path":"/name","value":"changed name"}]
|
|
66
66
|
1..1
|
|
67
|
-
ok 2 - clean repo pending change # time=0.
|
|
67
|
+
ok 2 - clean repo pending change # time=0.632ms
|
|
68
68
|
|
|
69
69
|
# Subtest: reading status shouldn't clean observer
|
|
70
70
|
ok 1 - Status doesn't contain the expected \# of changes: [{"op":"replace","path":"/name","value":"changed name"}]
|
|
71
71
|
ok 2 - Status doesn't contain the expected \# of changes: [{"op":"replace","path":"/name","value":"changed name"}]
|
|
72
72
|
ok 3 - why different pending changes??
|
|
73
73
|
1..3
|
|
74
|
-
ok 3 - reading status shouldn't clean observer # time=1.
|
|
74
|
+
ok 3 - reading status shouldn't clean observer # time=1.058ms
|
|
75
75
|
|
|
76
76
|
# Subtest: after commit no change
|
|
77
77
|
ok 1 - Shouldn't have pending changes
|
|
78
78
|
1..1
|
|
79
|
-
ok 4 - after commit no change # time=1.
|
|
79
|
+
ok 4 - after commit no change # time=1.177ms
|
|
80
80
|
|
|
81
81
|
# Subtest: after commit pending change
|
|
82
82
|
ok 1 - Shouldn't have pending changes
|
|
83
83
|
ok 2 - Status doesn't contain changes
|
|
84
84
|
1..2
|
|
85
|
-
ok 5 - after commit pending change # time=1.
|
|
85
|
+
ok 5 - after commit pending change # time=1.347ms
|
|
86
86
|
|
|
87
87
|
# Subtest: after commit pending change for rewrite array
|
|
88
88
|
ok 1 - Shouldn't have pending changes
|
|
89
89
|
ok 2 - Status doesn't contain changes
|
|
90
90
|
1..2
|
|
91
|
-
ok 6 - after commit pending change for rewrite array # time=1.
|
|
91
|
+
ok 6 - after commit pending change for rewrite array # time=1.355ms
|
|
92
92
|
|
|
93
93
|
# Subtest: change of nested array element prop
|
|
94
94
|
ok 1 - Shouldn't have pending changes
|
|
95
95
|
ok 2 - Status doesn't contain changes
|
|
96
96
|
1..2
|
|
97
|
-
ok 7 - change of nested array element prop # time=1.
|
|
97
|
+
ok 7 - change of nested array element prop # time=1.673ms
|
|
98
98
|
|
|
99
99
|
1..7
|
|
100
|
-
ok 5 - status # time=
|
|
100
|
+
ok 5 - status # time=462.807ms
|
|
101
101
|
|
|
102
102
|
# Subtest: apply
|
|
103
103
|
# Subtest: single patch
|
|
@@ -107,7 +107,7 @@ ok 5 - status # time=506.042ms
|
|
|
107
107
|
ok 4 - Status doesn't contain changes
|
|
108
108
|
ok 5 - It should have the right changes
|
|
109
109
|
1..5
|
|
110
|
-
ok 1 - single patch # time=107.
|
|
110
|
+
ok 1 - single patch # time=107.416ms
|
|
111
111
|
|
|
112
112
|
# Subtest: patch for undefined props with workaround
|
|
113
113
|
ok 1 - Shouldn't have pending changes
|
|
@@ -115,7 +115,7 @@ ok 5 - status # time=506.042ms
|
|
|
115
115
|
ok 3 - The final state should match up
|
|
116
116
|
ok 4 - Status should contain 1 change
|
|
117
117
|
1..4
|
|
118
|
-
ok 2 - patch for undefined props with workaround # time=1.
|
|
118
|
+
ok 2 - patch for undefined props with workaround # time=1.687ms
|
|
119
119
|
|
|
120
120
|
# Subtest: multiple patches
|
|
121
121
|
ok 1 - Shouldn't have pending changes
|
|
@@ -124,14 +124,14 @@ ok 5 - status # time=506.042ms
|
|
|
124
124
|
ok 4 - It should have the right changes
|
|
125
125
|
ok 5 - The final state does not match up
|
|
126
126
|
1..5
|
|
127
|
-
ok 3 - multiple patches # time=1.
|
|
127
|
+
ok 3 - multiple patches # time=1.817ms
|
|
128
128
|
|
|
129
129
|
1..3
|
|
130
|
-
ok 6 - apply # time=
|
|
130
|
+
ok 6 - apply # time=164.57ms
|
|
131
131
|
|
|
132
132
|
# Subtest: restoring from history
|
|
133
133
|
ok 1 - restored object does not equal last version.
|
|
134
134
|
1..1
|
|
135
|
-
ok 7 - restoring from history # time=2.
|
|
135
|
+
ok 7 - restoring from history # time=2.868ms
|
|
136
136
|
|
|
137
137
|
1..7
|
|
@@ -2,18 +2,18 @@ TAP version 14
|
|
|
2
2
|
# Subtest: cannot tag on an empty repo
|
|
3
3
|
ok 1 - expected to throw
|
|
4
4
|
1..1
|
|
5
|
-
ok 1 - cannot tag on an empty repo # time=
|
|
5
|
+
ok 1 - cannot tag on an empty repo # time=26.484ms
|
|
6
6
|
|
|
7
7
|
# Subtest: can create simple tag pointing to HEAD
|
|
8
8
|
ok 1 - should be equal
|
|
9
9
|
ok 2 - tag is not pointing to expected commit
|
|
10
10
|
ok 3 - reference was not present in history
|
|
11
11
|
1..3
|
|
12
|
-
ok 2 - can create simple tag pointing to HEAD # time=
|
|
12
|
+
ok 2 - can create simple tag pointing to HEAD # time=20.333ms
|
|
13
13
|
|
|
14
14
|
# Subtest: cannot create tag with whitespace
|
|
15
15
|
ok 1 - expected to throw
|
|
16
16
|
1..1
|
|
17
|
-
ok 3 - cannot create tag with whitespace # time=
|
|
17
|
+
ok 3 - cannot create tag with whitespace # time=3.092ms
|
|
18
18
|
|
|
19
19
|
1..3
|
|
@@ -3,41 +3,41 @@ TAP version 14
|
|
|
3
3
|
ok 1 - should be equal
|
|
4
4
|
ok 2 - should be equal
|
|
5
5
|
1..2
|
|
6
|
-
ok 1 - author <email@domain.info> # time=3.
|
|
6
|
+
ok 1 - author <email@domain.info> # time=3.718ms
|
|
7
7
|
|
|
8
8
|
# Subtest: author with space <email@domain.info>
|
|
9
9
|
ok 1 - should be equal
|
|
10
10
|
ok 2 - should be equal
|
|
11
11
|
1..2
|
|
12
|
-
ok 2 - author with space <email@domain.info> # time=0.
|
|
12
|
+
ok 2 - author with space <email@domain.info> # time=0.644ms
|
|
13
13
|
|
|
14
14
|
# Subtest: author @handle
|
|
15
15
|
ok 1 - should be equal
|
|
16
16
|
ok 2 - should be equal
|
|
17
17
|
1..2
|
|
18
|
-
ok 3 - author @handle # time=0.
|
|
18
|
+
ok 3 - author @handle # time=0.429ms
|
|
19
19
|
|
|
20
20
|
# Subtest: author with space @handle
|
|
21
21
|
ok 1 - should be equal
|
|
22
22
|
ok 2 - should be equal
|
|
23
23
|
1..2
|
|
24
|
-
ok 4 - author with space @handle # time=0.
|
|
24
|
+
ok 4 - author with space @handle # time=0.447ms
|
|
25
25
|
|
|
26
26
|
# Subtest: email@domain.info
|
|
27
27
|
ok 1 - should be equal
|
|
28
28
|
ok 2 - should be equal
|
|
29
29
|
1..2
|
|
30
|
-
ok 5 - email@domain.info # time=0.
|
|
30
|
+
ok 5 - email@domain.info # time=0.602ms
|
|
31
31
|
|
|
32
32
|
# Subtest: @handle
|
|
33
33
|
ok 1 - should be equal
|
|
34
34
|
ok 2 - should be equal
|
|
35
35
|
1..2
|
|
36
|
-
ok 6 - @handle # time=0.
|
|
36
|
+
ok 6 - @handle # time=0.585ms
|
|
37
37
|
|
|
38
38
|
# Subtest: empty author
|
|
39
39
|
ok 1 - expected to throw
|
|
40
40
|
1..1
|
|
41
|
-
ok 7 - empty author # time=
|
|
41
|
+
ok 7 - empty author # time=2.222ms
|
|
42
42
|
|
|
43
43
|
1..7
|
package/CHANGELOG.md
CHANGED
|
@@ -1,3 +1,16 @@
|
|
|
1
|
+
# v0.8.0 (Sat Mar 23 2024)
|
|
2
|
+
|
|
3
|
+
#### 🚀 Enhancement
|
|
4
|
+
|
|
5
|
+
- feat: expose util functions [#160](https://github.com/dotindustries/ogre/pull/160) ([@nadilas](https://github.com/nadilas))
|
|
6
|
+
- feat: expose util functions ([@nadilas](https://github.com/nadilas))
|
|
7
|
+
|
|
8
|
+
#### Authors: 1
|
|
9
|
+
|
|
10
|
+
- [@nadilas](https://github.com/nadilas)
|
|
11
|
+
|
|
12
|
+
---
|
|
13
|
+
|
|
1
14
|
# v0.7.0 (Sat Mar 23 2024)
|
|
2
15
|
|
|
3
16
|
#### 🚀 Enhancement
|
package/lib/git2json.js
CHANGED
|
@@ -1,21 +1,20 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.formatGit2Json = void 0;
|
|
4
|
-
const repository_1 = require("./repository");
|
|
5
4
|
const utils_1 = require("./utils");
|
|
6
5
|
const findRefs = (commit, refs) => {
|
|
7
6
|
const list = [];
|
|
8
|
-
const headRef = refs.get(
|
|
7
|
+
const headRef = refs.get(utils_1.REFS_HEAD_KEY);
|
|
9
8
|
for (const [key, ref] of refs.entries()) {
|
|
10
9
|
if (ref.value === commit.hash) {
|
|
11
|
-
if ((0,
|
|
10
|
+
if ((0, utils_1.isTagRef)(key)) {
|
|
12
11
|
list.push(`tag: ${ref.name}`);
|
|
13
12
|
}
|
|
14
13
|
else {
|
|
15
14
|
list.push(ref.name);
|
|
16
15
|
}
|
|
17
16
|
// also check if HEAD is pointing to this ref
|
|
18
|
-
if (headRef && headRef.value === (0,
|
|
17
|
+
if (headRef && headRef.value === (0, utils_1.createHeadRefValue)(key)) {
|
|
19
18
|
list.push(headRef.name);
|
|
20
19
|
}
|
|
21
20
|
}
|
package/lib/repository.d.ts
CHANGED
|
@@ -1,8 +1,6 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { JsonPatchError, Operation } from "fast-json-patch";
|
|
2
2
|
import { Commit } from "./commit";
|
|
3
3
|
import { History, Reference } from "./interfaces";
|
|
4
|
-
export declare const REFS_HEAD_KEY = "HEAD";
|
|
5
|
-
export declare const REFS_MAIN_KEY: string;
|
|
6
4
|
export interface RepositoryOptions<T extends {
|
|
7
5
|
[k: string]: any;
|
|
8
6
|
}> {
|
|
@@ -87,18 +85,3 @@ export declare class Repository<T extends {
|
|
|
87
85
|
ref(reference: string): string | undefined;
|
|
88
86
|
tag(tag: string): string;
|
|
89
87
|
}
|
|
90
|
-
export declare const createHeadRefValue: (refKey: string) => string;
|
|
91
|
-
export declare const isTagRef: (refKey: string) => boolean;
|
|
92
|
-
export declare const cleanRefValue: (ref: string) => string;
|
|
93
|
-
export declare const brancheNameToRef: (name: string) => string;
|
|
94
|
-
export declare const tagToRef: (tag: string) => string;
|
|
95
|
-
export declare const validateBranchName: (name: string) => void;
|
|
96
|
-
export declare const validateRef: (name: string, oneLevel?: boolean) => void;
|
|
97
|
-
/**
|
|
98
|
-
* Prints the underlying changelog of a repository
|
|
99
|
-
* @param repository
|
|
100
|
-
*/
|
|
101
|
-
export declare const printChangeLog: <T extends {
|
|
102
|
-
[k: string]: any;
|
|
103
|
-
}>(repository: RepositoryObject<T>) => void;
|
|
104
|
-
export declare const printChange: (chg: Operation) => void;
|